Convert char[] to LPCWSTR

前端 未结 5 924
轻奢々
轻奢々 2020-11-30 13:05

Can anyone help me to correct this code:

    char szBuff[64];
    sprintf(szBuff, \"%p\", m_hWnd);
    MessageBox(NULL, szBuff, L\"Test print handler\", MB_O         


        
5条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-30 13:14

    If you are compiling with UNICODE, make all the strings you work with double width - i.e. define them as wchar_t*.

    If you really must convert ASCII to Unicode, use ATL conversion macros.

提交回复
热议问题