1、纯资源DLL文件已经生成。(Regular DLL using shared MFC DLL方式,资源全部用应用程序资源替换加入,"Link"中加了"/NOENTRY","Resource"中删除了"_AFXDLL")
2、MFC应用程序删除了所有资源,在程序名.cpp->BOOL CMultilanguageApp::InitInstance()中加入两句:
m_hDLL=::LoadLibrary("***.dll");//m_hDLL已定义为HINSTANCE变量
AfxSetResourceHandle(m_hDLL);
编译生成应用程序没问题。但不能运行,一运行就报错“建立空文档失败”,将DLL文件移到应用程序目录下,一样的错误!
我已经花了两天时间了,尝试各种可能,均不能成功,还盼诸位高手指点一番,高分相送啊!

解决方案 »

  1.   

    看看有没有http://topic.csdn.net/t/20050729/13/4176394.html
      

  2.   

    纯资源DLL应该是Regular DLL using shared MFC DLL和扩展DLL都可以吧。
    CathySun118(斯年)推荐的扩展DLL文章看了,做了一遍,出现两个问题:
    1、在新建的*.RC中无法添加字符串资源;
    2、只添加图标资源完成所有步骤后(以MFC的对话框做为应用程序),调用原有资源没问题,但调用纯资源DLL时,只能弹出hDll!=NULL的“Success”提示框,并不能显示图标资源。
    所以问题还是没有解决。
      

  3.   

    m_hResDll = LoadLibrary(_T("ResDll.dll"));
    if(m_hResDll != NULL)
    {
    //if found:

    //1 - puts exe module in extension dll chain (using an instance of CDynLinkLibrary)
    m_pExeModule = new CDynLinkLibrary(AfxGetInstanceHandle(), AfxGetResourceHandle());

    //2 - puts dll as principal resources supplier
    AfxSetResourceHandle(m_hResDll);

    //now a resource is searched starting from resdll and if not found, is searched in
    //exe module
    }