- For converting from a char* to a CString:
char* charStar= NULL; // Code that sets the value of charStar CString data; data.Format("%s", charStar);
- Same thing works for converting from a LPCTSTR to a CString:
void SomeMethod(LPCTSTR argument) { CString data; data.Format("%s", argument); }
- And for converting from a char* to a LPCTSTR:
void SomeMethod(LPCTSTR argument) { }
char* charStar = NULL; // Code that sets the value of charStar SomeMethod(charStar);
Simple, and yet for some reason, I have had a hard time remembering this.
No comments:
Post a Comment