我是用的vc2008写的代码:         HRSRC hRes = FindResource(NULL, MAKEINTRESOURCE(IDR_HTML1),RT_HTML);
HGLOBAL hResLoad = LoadResource(NULL, hRes);
LPVOID lpResLock = LockResource(hResLoad);
CString strRes;
strRes.Format(_T("%s"), (LPCTSTR)lpResLock);
          MessageBox(strRes);
不怎么显示出来后是乱码请各位帮忙,小弟谢谢了!!!!!

解决方案 »

  1.   

    感觉你用错了吧Q!可以查一下msdn 吧!
      

  2.   

    关键资源本身和程序是否匹配,例如:资源是ASNI的,而程序是Unicode
      

  3.   

    ansi资源,在unicode下使用了//**************************************
    // ansi字符串转unicode string字符串
    // 返回大于0成功,小于0失败
    //**************************************
    int
    astr_ustring( char *ansistr, CString *string )
    {
    int result = 0;

    try
    {
    //size_t len = strlen( ansistr );
    int needlen = MultiByteToWideChar( g____ansi_codepage, 0, ansistr, -1, NULL, 0 );
    if( needlen < 0 )
    {
    return needlen;
    } WCHAR *unicodestr = new WCHAR[ needlen + 10 ]; //128K
    if( !unicodestr )
    {
    return -1;
    } result = MultiByteToWideChar( g____ansi_codepage, 0, ansistr, -1, unicodestr, needlen + 1 );
    if( result < 0 )
    {
    return result;
    }
    *string = ( CString )unicodestr;
    delete []unicodestr;
    return result;
    }
    catch( ... )
    {
    ShowError();
    } return result;
    }