wcstok,strtok memory corruption
CString mystring("ob_jw_ay");
CString anotherstring ;
anotherstring =mystring;//memory corruption!!!
TCHAR* string = (TCHAR*)(LPCTSTR)mystring;
TCHAR seps[] = "_";
TCHAR* token;
token = strtok( string, seps );
while( token != NULL )
token = strtok( NULL, seps );
//Now both strings will be changed.Because both CString::m_pchData are pointing to the same memory and strok/wcstok changes it. If you want 'anotherstring' to remain unchanged do
anotherstring + =mystring;