IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)

解决方案 »

  1.   

    使用CMainFrame支持动态创见嘛,看看《深入浅出MFC》
      

  2.   

    Use this macro with the DECLARE_DYNCREATE macro to enable objects of CObject-derived classes to be created dynamically at run time. The framework uses this ability to create new objects dynamically, for example, when it reads an object from disk during serialization. Add the IMPLEMENT_DYNCREATE macro in the class implementation file.If you use the DECLARE_DYNCREATE and IMPLEMENT_DYNCREATE macros, you can then use the RUNTIME_CLASS macro and the CObject::IsKindOf method to determine the class of your objects at run time.If DECLARE_DYNCREATE is included in the class declaration, then IMPLEMENT_DYNCREATE must be included in the class implementation.