(1)应用程序类的声明
class CSimGraphApp : public CWinApp
{
public:
CSimGraphApp();//构造函数
// Overrides
// ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CSimGraphApp) public: virtual BOOL InitInstance();//初始化应用环境
//}}AFX_VIRTUAL
// Implementation
};
(2)应用程序类的InitInstance函数的关键代码:
CSingleDocTemplate* pDocTemplate; //声明文档模板指针 pDocTemplate = new CSingleDocTemplate( //创建文档模板 IDR_MAINFRAME, //文档模板使用的资源ID RUNTIME_CLASS(CSimGraphDoc), //文档对象的信息 RUNTIME_CLASS(CMainFrame), //主帧窗口对象的信息 RUNTIME_CLASS(CSimGraphView));//视图窗口对象的信息 //{{AFX_MSG(CSimGraphApp) afx_msg void OnAppAbout(); // NOTE - the ClassWizard will add and remove member functions here. // DO NOT EDIT what you see in these blocks of generated code ! //}}AFX_MSG DECLARE_MESSAGE_MAP()//声明消息映射表 AddDocTemplate(pDocTemplate);//加入文档模板列表
(3)文档模板对象:
用于保存文档/视图结构中各个类的信息,当新建一个文档时,VC自动生成的代码(OnFileNew函数)会被执行,并构造3个对象,共同组成一个文档/视图结构。
其中RUNTIME_CLASS是一个宏调用,它返回一个指向CRuntimeClass结构的指针,该结构中保存了指定类的信息。
CRuntimeClass结构的成员如下:
CRuntimeClass称为类信息表,其结构的成员如下:
LPCSTR m_lpszClassName //类名
int m_nObjectSize
UINT m_wSchema //对象大小 //对象的版本号,一般为1
CObject* ( PASCAL* m_pfnCreateObject )( )//返回工厂函数的指针,
CRuntimeClass* ( PASCAL* m_pfn_GetBaseClass )( ) //返回基类信息表
CRuntimeClass* m_pBaseClass //基类信息表指针
Windows应用程序设计复习资料_计算机软件及应用_IT/计算机_专业资料。Windows应用程序设计复习资料一、简答题 1.利用 Visual Studio 2005 开发程序时,Windows 应用...
Windows程序设计复习资料_IT/计算机_专业资料。程序设计一、单项选择题: 1.WinMain()函数的工作。 WinMain()函数是 Windows 程序的入口点 2. MFC 的 Windows ...
MFC Windows应用程序设计复习资料_理学_高等教育_教育专区。MFC Windows应用程序设计复习资料Windows 核心编程复习资料 WINDOWS 核心编程复习资料 1-1 什么是 Windows...
MFCWindows程序设计复习资料。_理学_高等教育_教育专区 暂无评价
四川理工学院 软件工程 Windows程序设计复习资料(完整答案)_工学_高等教育_教育专区。四川理工学院 软件工程 Windows程序设计复习资料(完整答案) 老师张立人!...
MFC应用程序设计复习资料_工学_高等教育_教育专区。MFC Windows应用程序设计(第2版)清华大学出版社 任哲 期末考试复习资料MFC 应用程序设计复习资料 应用程序设计...
Windows程序设计复习资料... 2页 免费windows...以及虚拟地址空 间的大小 2.1 windows 文件系统 Windows 支持 4 种文件系统。...
Windows复习资料_IT认证_资格考试/认证_教育专区。画刷 using System; using ... //恢复事件处理程序 this.italicToolStripMenuItem.CheckedChanged += Event...
Windows sever2003配置... 暂无评价 5页 2下载券 sever2003复习资料 7页 1下载券 windows程序复习资料 18页 免费 喜欢此文档的还喜欢 Windows server 2003 总...
windows操作系统复习资料_IT/计算机_专业资料。windows操作系统复习资料...FAT32 C. NTFS 16.在操作系统中, (B A.程序 C.作业 17.很好地解决了...
热门文档