M
Mike
Hi,
I need to acces a string (wchar_t*) in a C++ (win32) DLL from within
the Compact Framework.
The C++ Syntax is like this:
extern "C" __declspec(dllexport) int SomeFunc(wchar_t
*someString[128])
{
*someString = _T("Enter some text...");
}
In the c# code I declare the function as
[DllImport("myTest.dll", EntryPoint = "SomeFunc")]
static extern int SomeFunc(StringBuilder someString);
and access it with
StringBuilder sb = new StringBuilder(128);
int result = SomeFunc(sb);
The only thing I get back are 2 hieroglyphs.
I tried passing in a string and a IntPtr as well, but nothing works.
The netcf-interop-logfile looks like this:
int SomeFunc(System.Text.StringBuilder);
int (I4_VAL) SomeFunc(WCHAR * (STRINGBUILDER_LPWSTR));
Can anyone give me a hint what I am doing wrong?
Thanks in advance.
Mike
I need to acces a string (wchar_t*) in a C++ (win32) DLL from within
the Compact Framework.
The C++ Syntax is like this:
extern "C" __declspec(dllexport) int SomeFunc(wchar_t
*someString[128])
{
*someString = _T("Enter some text...");
}
In the c# code I declare the function as
[DllImport("myTest.dll", EntryPoint = "SomeFunc")]
static extern int SomeFunc(StringBuilder someString);
and access it with
StringBuilder sb = new StringBuilder(128);
int result = SomeFunc(sb);
The only thing I get back are 2 hieroglyphs.
I tried passing in a string and a IntPtr as well, but nothing works.
The netcf-interop-logfile looks like this:
int SomeFunc(System.Text.StringBuilder);
int (I4_VAL) SomeFunc(WCHAR * (STRINGBUILDER_LPWSTR));
Can anyone give me a hint what I am doing wrong?
Thanks in advance.
Mike