I have an unmanaged C ++ function inside a Dll that I call from my C # application. Here is the function signature:
GetCrashMeasurement(LPCTSTR channelName, LPCTSTR properties, LPCTSTR * Values, HANDLE error)
where channelNameand propertiesis the input parameter [in]; and Values- output parameter [out].
I also use the invoke platform from my C # application as follows:
[DllImport("DrvCrashHAL.dll", EntryPoint = "coCRAL_GetCrashMeasurements")]
public static unsafe extern CoStatus GetCrashMeasurements(string sChannel, string sMeasurements, ref string sValues, IntPtr hError);
From my C # application, I call the function as follows:
string Text = "";
intptr herror = intptr.zero;
GetCrashMeasurements("channelname","",ref Text,herror);
But then my program stops exactly on this line, without throwing any exception, and all I see in the output window is the following message:
Critical error detected c0000374
Critical error detected c0000374
The program '[4964] ProjectX.exe: Managed' has exited with code 0 (0x0).
The program '[4964] ProjectX.exe: Native' has exited with code 0 (0x0).
My guess is that the problem is with the sort type LPCTSTR.
Can someone tell me what I'm doing wrong or point me in the right direction?
Thanks in advance.