已答覆 Writing text to LCD w/ wince 6.0 + VS2005

  • Tuesday, February 07, 2012 6:18 PM
     
     

    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

     


    • Edited by CodeMan007 Wednesday, February 08, 2012 11:36 PM
    •  

All Replies

  • Thursday, February 09, 2012 9:02 AM
    Moderator
     
     

    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,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

  • Thursday, February 09, 2012 4:17 PM
     
     Answered

    Hi Jesse,

    Thanks for your thoughts.  I'll check on that.

    CM007

    • Marked As Answer by CodeMan007 Thursday, February 09, 2012 9:24 PM
    •  
  • Thursday, February 09, 2012 9:27 PM
     
     Answered

    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

  • Friday, February 10, 2012 5:41 AM
    Moderator
     
     


    Thanks for sharing the solution.

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us