Software Development Network>> Visual C++>> MFC -> String* to const char* or String* to char
How can I convert a String* in MFC to const char* mychar or char mychar[MAX_PATH]
MFC -> String* to const char* or String* to char
_Quimbly_
i'm pretty sure this is not the most efficient way to do this, but it's a simple way :-)
you can simply create a mfc CString using the ctor that takes the a String*, because CStrings have build-in conversion operators for const char*.
WM_HOPETHISHELPS
thomas woelfer
http://www.die.de/blog
BugEyeMonster
http://blog.kalmbachnet.de/ postid=18
See: How To Convert from System:: String* to Char* in Visual C++ .NET
http://support.microsoft.com/kb/311259/
kunalb
//method 3
CString str3(str);