Writing text to LCD w/ wince 6.0 + VS2005
-
Dienstag, 7. Februar 2012 18:18
This can't be this difficult. I'm trying to simply write text to a dialog box on an LCD screen attached to a manufacturer's dev board using ExtTextOut for WinCE6.0/Platform Builder + VS2005 MFC project + embedded SmartDevice (ARM), and nothing works. Using SD card for transfer, leaving app on card. I see nothing on the screen. In my OSDesign, I have Graphics/direct draw checked. Here is my code:
int num;
HDC hdc;
Rect rect = {20,28,188,138};
TCHAR string[20];
StringCchPrintfW(string,_countof(string),_T("1234"));
SetTextColor(hdc, (250,0,0));
num = ExtTextOut (hdc,50,42,ETO_OPAQUE,&rect,string,4,NULL);
if (num == 0) AfxMessageBox (L"no srtring");
1) Is there a special setting in the OSDesign for this?
2) Why is this code not working?
Thanks, CM007
- Bearbeitet CodeMan007 Dienstag, 7. Februar 2012 18:20
- Bearbeitet CodeMan007 Dienstag, 7. Februar 2012 18:41
- Bearbeitet CodeMan007 Mittwoch, 8. Februar 2012 23:36
Alle Antworten
-
Donnerstag, 9. Februar 2012 09:02Moderator
Hello,
Did you have any sample codes provided by the OEM? Maybe the way to show the text is different from general MFC project.
Best regards,
JesseJesse Jiang [MSFT]
MSDN Community Support | Feedback to us
-
Donnerstag, 9. Februar 2012 16:17
Hi Jesse,
Thanks for your thoughts. I'll check on that.
CM007
- Als Antwort markiert CodeMan007 Donnerstag, 9. Februar 2012 21:24
-
Donnerstag, 9. Februar 2012 21:27
Hi Jesse,
Did find some code, and it works now! Looks like:
CPaintDC dc(this);
CString string;
string = L"hi"; "L" for wide character string
ExtTextOut(dc,150,100,0,NULL,string,2,NULL)
CM007
- Als Antwort markiert Jesse JiangMicrosoft Contingent Staff, Moderator Freitag, 10. Februar 2012 05:41
-
Freitag, 10. Februar 2012 05:41Moderator
Thanks for sharing the solution.Best regards,
Jesse
Jesse Jiang [MSFT]
MSDN Community Support | Feedback to us

