I have an unmanaged method in a DLL with the following signature:
extern "C" ErrorCodeEnum BuildSerialTriggerSetup(TriggerSetup_type sSetup, BYTE * pFPGACfgStream, UINT32 * piStreamLen)
I have a pinvoke set up in C# with the following signature:
[System.Runtime.InteropServices.DllImportAttribute("SerTrigLib.dll", EntryPoint = "BuildSerialTriggerSetup")]
public static extern ErrorCode_enum BuildSerialTriggerSetup(TriggerSetup_type sSetup, byte[] pFPGACfgStream, ref uint piStreamLen);
I then call the function with the following block of code:
TriggerSetup_type t = new TriggerSetup_type();
//fill up the TriggerSetup_type object
byte[] returnBytes = new byte[5000];
uint len = 5000;
ErrorCode_enum e = STSetupBuilder.BuildSerialTriggerSetup(t,returnBytes, ref len);
When I make the call into the unmanaged call, I keep getting as my value for the parameter "BYTE * pFPGACfgStream" . Can someone tell me what I'm doing wrong?