internal static string GetErrorMessage(int err) { IntPtr num = Marshal.AllocHGlobal(1024); HalconAPI.HLIGetErrorMessage(err, num); string str = HalconAPI.FromHalconEncoding(num); Marshal.FreeHGlobal(num); return(str); }