I recently converted my application into C# as VS2008 does not support new Data Sources (?!), but now I am stuck on one command from the old DLL.
Here is the old function declaration and command that worked in C++:
I definitely have the DLL loaded correctly in C# as the other commands work, but I have a feeling my syntax with sending the commands, which would be the LPSTR cmd delcaration. My C# code snippets are below.
So now my SendAT6400Block is not working in C# when it was working in my old C++ code. Could anyone provide any insight or do you need some more information?
Your help, as always, is greatly appreciated.
Here is the old function declaration and command that worked in C++:
Code:
typedef short(*pfunc2)(short address, LPSTR cmd, short irqnum);
pfunc2 pfSendAT6400Block = (pfunc2)GetProcAddress(hndl, "SendAT6400Block");
char *testCommands[258] = {"A100:V50:D254000:GO1:"}; //Pointer to a null-terminated string
SetTimeout(10000);
SendAT6400Block(768, *testCommands, 0);
I definitely have the DLL loaded correctly in C# as the other commands work, but I have a feeling my syntax with sending the commands, which would be the LPSTR cmd delcaration. My C# code snippets are below.
Code:
[DllImport("C:\\WINDOWS\\system32\\nt6400.dll", CharSet = CharSet.Auto)]
public static extern short SendAT6400Block(short address, [MarshalAs(UnmanagedType.LPStr)] string cmd, short irqnum);
string commandSTR = "A100:V50:D254000:G01:";
NT6400.SetTimeout(2000);
int SendBlockReturn = NT6400.SendAT6400Block(768, commandSTR, 0);
So now my SendAT6400Block is not working in C# when it was working in my old C++ code. Could anyone provide any insight or do you need some more information?
Your help, as always, is greatly appreciated.