Y
Yannick S.
hi all,
I want to construct a string in a dll and then call this function in C#. I
have try the MS samples but none work for the compact framework.
in my C dll :
yannick.c :
extern "C" YANNICK_DLL_API char* TestStringAsResult()
{
char* result = new char[64];//(char*)CoTaskMemAlloc( 64 );
strcpy( result, "This is return value" );
return result;
}
yannick.h :
extern "C" SWI_WIFIFUNCTIONS_DLL_API char* TestStringAsResult();
in my C# :
[ DllImport( "yannick.dll" )]
public static extern String TestStringAsResult();
but when I call the TestStringAsResult() method I have an exception
NotSupportedException.
can you help retrieve a string from a dll to my c# app ?
thx in advance.
I want to construct a string in a dll and then call this function in C#. I
have try the MS samples but none work for the compact framework.
in my C dll :
yannick.c :
extern "C" YANNICK_DLL_API char* TestStringAsResult()
{
char* result = new char[64];//(char*)CoTaskMemAlloc( 64 );
strcpy( result, "This is return value" );
return result;
}
yannick.h :
extern "C" SWI_WIFIFUNCTIONS_DLL_API char* TestStringAsResult();
in my C# :
[ DllImport( "yannick.dll" )]
public static extern String TestStringAsResult();
but when I call the TestStringAsResult() method I have an exception
NotSupportedException.
can you help retrieve a string from a dll to my c# app ?
thx in advance.