I need to call a DLL function in Pocket PC using C# for Compact
Framework. The function takes a "char *" variable. Assume the
function is declared something as following and "param" is an in and
out parameter:
extern "C" __declspec( dllexport ) char *Test(char *param)
In full .NET framework I can use the the following C# declaration and
use the function with no problem.
[DllImport("TestDLL.dll")]
public static extern string Test([MarshalAs(UnmanagedType.LPStr)]
StringBuilder buf);
But as you are aware, the Compact Framework does not support MarshalAs
attribute and I have not been able to call the function. I have
Googled for a solution but somehow I cannot find the right answer.
Would you please tell me how you pass a "char *" parameter in and out
of a DLL function in compact framework using C#.
Thanks in advance