CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2003
    Location
    FRANCE
    Posts
    22

    Question UNICODE with CString...

    Hello,

    I want to insert unicode character in a CString object using Format method.

    CString sBuf;
    int iCar = 0xB2; <----------------------- I would like to set 0x03B2
    sBuf.Format("Car is %c", iCar);

    How can I do that ?

    Thanks to all.
    Phil

  2. #2
    Join Date
    Jan 2004
    Location
    Earth
    Posts
    567

    Re: UNICODE with CString...

    Try CStringT

  3. #3
    Join Date
    Jun 2004
    Location
    Chicago, United States
    Posts
    88

    Re: UNICODE with CString...

    If your project is compiled with _UNICODE flag you can use:
    Code:
    CString sBuf;
    sBuf.Format(_T("Car is %c"), 0x03B2);
    otherwise
    Code:
    wchar_t buf[100];
    swprintf(buf,L"Car is %c",0x03B2);
    A.M.
    My Latest Articles:
    CCustomBitmapButton - An owner-draw button and a frame for the caption bar, in one class.
    CCustomTabCtrl - A clone of the Excel tab sheet control.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured