Apr 29, 2003 #1 B bwells Well-known member Joined Feb 25, 2003 Messages 84 How can I convert from a managed string (String*) to an unmanaged const char* to pass from a managed C++ class to a unmanaged C++ routine?
How can I convert from a managed string (String*) to an unmanaged const char* to pass from a managed C++ class to a unmanaged C++ routine?
May 20, 2003 #3 B bwells Well-known member Joined Feb 25, 2003 Messages 84 bool setSRAM( String* fname ) { void* pfname = Marshal::StringToHGlobalAnsi(fname).ToPointer( ); char* ufname = (char*)pfname; // do your stuff with ufname here Marshal::FreeHGlobal((int)ufname); }
bool setSRAM( String* fname ) { void* pfname = Marshal::StringToHGlobalAnsi(fname).ToPointer( ); char* ufname = (char*)pfname; // do your stuff with ufname here Marshal::FreeHGlobal((int)ufname); }