紧急求助:关于在mfc的共享dll中使用msflexgrid的问题??我作了个mfc的共享dll,有个对话框,然后在对话框上插入msflexgrid控件,编译都正常,但是mfc作的对话框exe调用dll时没反应。mfc的对话框exe程序中,在对话框上插入msflexgrid控件,显示正常。而且如果dll中用的是默认提供的控件也能正常显示,就是导入的控件不好用。谁能指点一下阿,谢谢。

解决方案 »

  1.   

    我刚刚弄明白,我来告诉你!在APP类中添加InitInstance() 事件处理函数;然后再函数中作初始化操作: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 here

    return CWinApp::InitInstance();
    }