troubleshooting Question

UNICODE and CEdit

Avatar of hansw77041
hansw77041 asked on
System Programming
14 Comments1 Solution1916 ViewsLast Modified:
Once again CEdit in a UNICODE project give me problems:

I'm using  a CEdit Control like this

CEdit m_cEdit; // in the dialog  .h file

m_cEdit.SubclassDlgItem( IDC_EDIT2, this ); in the OnInitDialog()

If I type 1234 in the edit control and then use the following code:

CString s;
m_cEdit.GetWindowText(s);
AfxMessageBox(s);      // nothing displays it's blank.

If I highlight the string and Right Click / Copy then Paste it into Notepad the pasted value is 1234

The project is a UNICODE project. I have no problem viewing strings in the Debugger after setting  Tools /Options / Display unicode strings.  

Now the problem is gettting a string froma CEdit control &^%&^% I'm having doubts about UNICODE and MFC !

So how do I  get a string from a CEdit control ?

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 14 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros