HI:
我试图写一个Share MFC DLL,在dll中包含一个属性对话框,属性对话框中的其中一个属性页包含一个vsflexgrid 7.0的控件,在运行时,当我选择含有vsflexgri控件的属性页时,该页立即消失,且属性对话框中对应的tab也不见了。上次,我插入一个多行文本编辑框时,也出现同样的问题。这是怎么回事啊?谢谢

解决方案 »

  1.   

    没有,应该加在哪儿呢?
    我加在InitInstance中,如下:
    BOOL CMyApp::InitInstance()
    {
    // Register all OLE server (factories) as running.  This enables the
    //  OLE libraries to create objects from other applications.
    COleObjectFactory::RegisterAll();   bool ret = AfxOleInit(); // 刚刚加的 return TRUE;
    }依然是老样子。

      

  2.   

    Q140850 HOWTO: Properly Export Functions Using the MFC Shared Library 
    Q154320 BUG: AfxOleInit Returns TRUE Without Initializing OLE in a DLL 
      

  3.   

    使用CRichEditCtrl控件,显示之前必须调用AfxInitRichEdit()
      

  4.   

    如果你用的是现成的ocx控件,那么得先注册一下,regsvr32 控件名.ocx
      

  5.   

    已经根据jiangsheng(蒋晟.MSMVP2004Jan) 所提示的
    Q154320 BUG: AfxOleInit Returns TRUE Without Initializing OLE in a DLL 
    解决了问题。结论:DLL中的OLE的初始化最好在放在调用DLL的主应用程序中,而不要放在DLL中。