J
jimbrown
This works in VS2008 for 32-bit projects but fails for 64-bit
projects. How do I return a result that C# will interpret as a
string?
C#
[DllImport("hello.dll", CharSet = CharSet.Ansi)]
private static extern string getAString();
String xx = getAString();
C++ in "hello.dll"
extern "C" {
__declspec(dllexport) unsigned char * getAString()
{
printf("call made\n");
return (unsigned char *)"a string";
}
}
projects. How do I return a result that C# will interpret as a
string?
C#
[DllImport("hello.dll", CharSet = CharSet.Ansi)]
private static extern string getAString();
String xx = getAString();
C++ in "hello.dll"
extern "C" {
__declspec(dllexport) unsigned char * getAString()
{
printf("call made\n");
return (unsigned char *)"a string";
}
}