G
Guest
Hi, what I'm working on right now is putting my old C++ code into a DLL, and
accessing it from a C# application... but I'm running into some problems.
I need to pass and receive strings from the DLL, but the data isn't comign
through right. Here's a little test I made:
In the DLL:
bool __declspec(dllexport) CompareClass::LoadGameInfo(LPCWSTR Message)
{
AfxMessageBox(Message);
return true;
}
In C#:
[DllImport("DLL Test client.dll")]
public static extern bool LoadGameInfo(string Message);
LoadGameInfo("test");
The result:
A message box pops up but does not include any message.
I would very much appreciate a tutorial on such matters or simply an
explanation. Thank you.
accessing it from a C# application... but I'm running into some problems.
I need to pass and receive strings from the DLL, but the data isn't comign
through right. Here's a little test I made:
In the DLL:
bool __declspec(dllexport) CompareClass::LoadGameInfo(LPCWSTR Message)
{
AfxMessageBox(Message);
return true;
}
In C#:
[DllImport("DLL Test client.dll")]
public static extern bool LoadGameInfo(string Message);
LoadGameInfo("test");
The result:
A message box pops up but does not include any message.
I would very much appreciate a tutorial on such matters or simply an
explanation. Thank you.