The C++ function definition is this
__declspec(dllexport) LPWSTR __stdcall GetErrorString(int errCode);
And I call it in C# like this
[DllImport("DLLTest.dll")]
public static extern string GetErrorString(int errCode);
static void Main(string[] args)
{
string result = GetErrorString(5);
}
I get an unhandled exception of type System.Runtime.InteropServices.SEHException
I'm not even sure if it's ok for the C++ DLL to try to return a LPWSTR to C#...
Thanks.