Reputation: 9845
For some reason CString IsEmpty keeps returning true even though the CString is obviously not empty.
CString temp = "Hello";
if (temp.IsEmpty)
AfxMessageBox("temp is empty");
else
AfxMessageBox("temp is not empty");
Any reason why this is the case?
Upvotes: 1
Views: 2135
Reputation: 1
Iam not totally sure but try this:
CString temp( "Hello" );
I found in this link https://msdn.microsoft.com/en-us/library/aa314317%28v=vs.60%29.aspx Look at the end, it says
CString city = "Philadelphia"; // NOT the assignment operator
Hope this helps!:)
Upvotes: 0