Hi, I’m writing my GUI in C# and using okFrontPanel.dll. My wires and triggers are working properly but I’m having trouble with with the pipe. Here’s the relevant pieces of code followed by the error I’m getting.
unsafe private void GetData()
byte] ByteArray = new byte;
fixed (byte* buff_ptr = ByteArray)
long foo = XEM.okUsbFrontPanel_ReadFromPipeOut(handle, 0xA0, 656, buff_ptr);
unsafe class XEM
public static extern long okUsbFrontPanel_ReadFromPipeOut(int handle, int epAddr, long length, byte *data);
this builds fine but when I actually get to this spot in the program it hangs and gives me this error:
A call to PInvoke function ‘FDS!XEM::okUsbFrontPanel_ReadFromPipeOut’ has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.