在MFC扩展DLL中生成了一个对话框类,在对话框上面放了一个
ActiveX控件,在DLL的客户程序中导出这个对话框类并DoModal,结果弹出的
对话框上面ActiveX控件没有显示出来,我在DllMain中调用了
AfxEnableControlContainer()函数也没有效果。我也搜索了以往的
帖子,但都是规则DLL的情况,在扩展DLL中到底该如何做才能解决
问题呢?谢谢!

解决方案 »

  1.   

    BOOL   CMFCDLLApp::InitInstance()   
    {
    HRESULT   hr   =   OleInitialize(NULL);
    if   (hr   ==   S_FALSE)
    {
    OleUninitialize();
    }
    //   Call   if   using   OLE   Controls
    AfxEnableControlContainer();//   Register   all   OLE   server   (factories)   as   running.   This   enables   the
    //   OLE   libraries   to   create   objects   from   other   applications.
    COleObjectFactory::RegisterAll();//   TODO:   Add   your   specialized   code   herereturn   CWinApp::InitInstance();
    }