Call c# DLL from C++ with string Parameters

  • Thread starter Thread starter DasNeo
  • Start date Start date
D

DasNeo

Guest
Hey,

I'm trying to call my C#-DLL from C++ (DLL):


__declspec(dllexport) int CosComDoStuff( string one, string two)
{
try {
return CosCom::Diverse::DoStuff(one, two);
}
catch (Exception^) {
return 0;
}
}

'int CosCom::Diverse::DoStuff(System::String ^,System::String ^)':

cannot convert argument 1 from 'std::string' to 'System::String ^'

C# function:

static public int DoStuff(string one, string two)



How do I do that? I need to keep declspec.


Thanks,

André.

Continue reading...
 
Back
Top