D
devgrt
I have an eVC DLL that I call from C#. I want to pass a C# string to the dll
and then copy that string's data into a char buffer as shown below. It
fails. Could anyone help me fix this code to what it should be. Thank you!
eVC DLL:
int mydll(LPSTR s)
{
char data[40];
strcpy(data, s);
}
C# calling the DLL:
[DllImport("MyCProcess.dll")]
public static extern int mydll(string s);
int r = mydll("teststring");
and then copy that string's data into a char buffer as shown below. It
fails. Could anyone help me fix this code to what it should be. Thank you!
eVC DLL:
int mydll(LPSTR s)
{
char data[40];
strcpy(data, s);
}
C# calling the DLL:
[DllImport("MyCProcess.dll")]
public static extern int mydll(string s);
int r = mydll("teststring");