how to call a c++ function with wchar_t[] parameter
Hi,
I've got a unmanaged C++ DLL which exports 1 function:
Code:
extern "C" bool GetDatabaseInfo( UINT uiBuffCnt,
wchar_t wcDataSource[], wchar_t wcCatalog[],
wchar_t wcUsername[], wchar_t wcPassword[] )
Now I've got to call this function from c#. I tried it this way:
Code:
[ DllImport( "..\\mydll.dll" ) ]
internal static extern bool GetDatabaseInfo( uint uiBuffCnt,
ref string[] sDataSource,
ref string[] sCatalog,
ref string[] sUsername,
ref string[] sPassword
);
string[] sDataSource = new string[1024],
sCatalog = new string[1024],
sUsername = new string[1024],
sPassword = new string[1024];
GetDatabaseInfo( 1024, ref sDataSource, ref sCatalog, ref sUsername, ref sPassword );
But the call always fails. Can anyone give me a hint what i did wrong?
Thanks in Advance
Akademos