Converting managed string into ansi char*
Managed C++/CLI
1
Posts
1
Posters
1
Views
1
Watching
-
Im trying to use a unmanaged C dll from my MC++ dll and one of the functions requires a char* string into it. I have tried: CMethod ( "String" ) CMethod::CMethod( String* name ) { const wchar_t __pin* pinName = PtrToStringChars( name ); long result = DllMethod ( (char*) pinName ); } But the result tells me something is wrong! however if i hardcode the string long result = DllMethod ( (char*) "String" ); the result is OK! Im wondering if it has something to do with the ansi/unicode stuff.. Anyone who can help?