Hi,
I've got a unmanaged C++ DLL which exports 1 function:
Now I've got to call this function from c#. I tried it this way:Code:extern "C" bool GetDatabaseInfo( UINT uiBuffCnt, wchar_t wcDataSource[], wchar_t wcCatalog[], wchar_t wcUsername[], wchar_t wcPassword[] )
But the call always fails. Can anyone give me a hint what i did wrong?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 );
Thanks in Advance
Akademos




Reply With Quote