I am adding RFID programming support for Zebra printers to an existing printing application. In order program the RFID chip I need to send some raw printer codes using the Windows API call ExtEscape with the PASSTHROUGH flag.
I have imported the function like this.
[DllImport("gdi32.dll", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Ansi)]
public static extern int ExtEscape(IntPtr hDC, int nEscape, int cbInput, IntPtr inData, int cbOutput, IntPtr outData);
Problem I have is that when used with the PASSTHROUGH flag, the IntPtr needs to point to a struct with the size and the data. I have defined the struct like this.
public struct PasstroughData
{
public Int32 Size;
public byte[] Data;
}
So question is; how do I convert this to something I can use to call ExtEscape?