|
-
January 26th, 2011, 10:52 AM
#1
Retrieving Arabic characters using GetWindowText?
I am using Windows XP and Visual C++ and have the Arabic language pack installed so that I can switch from English to Arabic as needed. In my program I have a RichEditCtrl that allows a user to type in text on a single or multiple lines. My problem is, when I try to fetch the text from the RichEditCtrl using GetWindowText I get a "?" for every Arabic character. Here is the code I tried:
Code:
CRichEditCtrl* myEditCtrl = GetEdit( CtrlDefiniitions::COMPOSITION_EDIT );
CString myString;
myEditCtrl->GetWindowText(myString);
I also read somewhere that perhaps my language settings were not correct, however, the article I read was 8 years old and I couldn't get the settings to match what they were talking about here: http://www.tek-tips.com/viewthread.cfm?qid=256666
Another method I have tried is to use GetLine instead of GetWindowText, but I am unable to figure out how to get all of the lines from the RichEditCtrl into a single CString object. Here is the code I tried for that:
Code:
TCHAR tCharLine[4096];
CRichEditCtrl* myEditCtrl = GetEdit( CtrlDefiniitions::COMPOSITION_EDIT );
\\ This only gives me the first line from the RichEditCtrl, but I want all of the lines!
int nBytesCopied = myEditCtrl->GetLine(0, tCharLine, sizeof(tCharline)/sizeof(tCharLine[0]));
CString myString(tCharLine);
The 2nd code snippet gives me the proper character output but only gives me the first line from the RichEditCtrl . Any ideas/suggestions?
"My software doesn't have bugs, it just develops random features."
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|