Click here to Skip to main content
15,888,062 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my VS2010 MFC app (which was fairly recently convert from VS6) I have a piece of dialog code where I'm trying to initialize a CString to blank.

I've got:

C++
CString strX = _T("");
strX.Empty();


But after both operations, the debugger shows that the strX variable contains the string "standard".

It's driving me mad!

Can anyone suggest where it is coming from and how to get my VS2010 CString to work like my old VS6 CString?
Posted

OK - so far it appears that some third party code is overwriting the CNilStringData member of the default ATL string manager, changing the defition of a NULL string...
 
Share this answer
 
Find out where the string "standard" is used,and check whether the sscanf() function is used. If so, maybe that is the problem. CString is a type for MFC, however sscanf() is a method of C.Do not use CString with sscanf(), just replace CString with char *. Hope it helps you.
 
Share this answer
 
Comments
CHill60 25-Jun-15 6:47am    
The question is over 2 years old - which is why you are getting downvotes

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900