ASCII (ANSI) MFC application with unicode support ? - Programmer

This is a discussion on ASCII (ANSI) MFC application with unicode support ? - Programmer ; Hi I' working on an ASCII/ANSI application whit a CEdit control in a dialog. How do I make this CEdit control Unicode enabled without making the whole application Unicode enabled ? If it can't be done with CEdit how about ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: ASCII (ANSI) MFC application with unicode support ?

  1. ASCII (ANSI) MFC application with unicode support ?

    Hi

    I' working on an ASCII/ANSI application whit a CEdit control in a dialog.
    How do I make this CEdit control Unicode enabled without making the whole
    application Unicode enabled ?
    If it can't be done with CEdit how about CRichEditCtrl, how is it done with
    that ?

    I hope somebody of you gurus have the knowledge about this, because I have
    been strugelling all day with this problem.

    Thanks in advance.

    Dennis



  2. Re: ASCII (ANSI) MFC application with unicode support ?

    One way is to I guess instead of putting the control in the template,
    you create it in OnInitDialog().

    something like this:
    m_edtText.Attach(::CreateWindowExW(WS_EX_CLIENTEDG E, L"EDIT", L"",
    WS_CHILD | WS_TABSTOP | WS_VISIBLE, 0, 0, 100, 100, m_hWnd, IDC_TEXT,
    AfxGetInstanceHandle(), NULL));

    Make sure you use the W function explicitly to have the edit control
    use Unicode.

    Rich Edit Controls 2.0 and later are internally Unicode-based so you
    should be fine with that.

    Of course to get full Unicode support you need Windows NT/2000/XP...

    hope it helps.


    Dennis wrote:
    > Hi
    >
    > I' working on an ASCII/ANSI application whit a CEdit control in a dialog.
    > How do I make this CEdit control Unicode enabled without making the whole
    > application Unicode enabled ?
    > If it can't be done with CEdit how about CRichEditCtrl, how is it done with
    > that ?
    >
    > I hope somebody of you gurus have the knowledge about this, because I have
    > been strugelling all day with this problem.
    >
    > Thanks in advance.
    >
    > Dennis



+ Reply to Thread