1)CMyApp declares no data members

2)CWinApp::InitInstance run after application build but before the window is create

2.1 InitInstance is the perfect place to perform initializations that need to be done each time the program starts(Just like VB's formload?)

2.2m_pMainWnd = new CMainWindow; (in InitInstance ):constructs a CMainWindow object and copies its address to the application object's m_pMainWnd data member

2.3 a window is not initially visible unless it is created with a WS_VISIBLE
attribute—by calling ShowWindow and UpdateWindow through the CMainWindow pointer:

(ShowWindow and UpdateWindow are CWnd member functions common to all window objects)

2.4can use ExitInstance to clean up when an application terminates

3)onldle\run \exitinstance\pretranslatemessage

4)Right after starting, AfxWinMain calls a function named AfxWinInit to initialize the framework and copy hInstance, nCmdShow,and other AfxWinMain function parameters to data members of the application object.

Then it calls InitApplication andInitInstance

5)An MFC application creates a window by creating a window object and calling its Create or CreateEx function. Hello creates a CMainWindow object in CMyApp::InitInstance. CMainWindow's constructor creates the window you see on the screen:

programming+windows+MFC的更多相关文章

  1. 「Windows MFC 」「Edit Control」 控件

    「Windows MFC 」「Edit Control」 控件

  2. windows mfc 程序,不同程序通信和互斥

    1. 共享内存(项目中使用过) 我转备份文章:http://www.cnblogs.com/swing07/p/8087686.html CreateFileMapping 或 OpenFileMap ...

  3. Windows MFC 打开文本

    MFC的CFileDialog自动封装了文件相关的对话框,提供一种简单的文件打开和文件存盘对话框功能. 要使用CFileDialog类,首先要构造一个对象, 项目实例: CFileDialog fil ...

  4. Windows MFC控件消息编程

    1. Progress Bar Control Messages    PBM_DELTAPOS    PBM_GETPOS    PBM_GETRANGE    PBM_SETBARCOLOR    ...

  5. Windows MFC 两个OpenGL窗口显示与线程RC问题

    问题为:背景界面是一个OpenGL窗口(对话框),在其上弹出一个OpenGL窗口(模态对话框)时, 1.上方的OpenGL窗口能响应鼠标操作等并刷新: 2.当移动或放大缩小上方的OpenGL窗口时,其 ...

  6. [游戏学习28] MFC 时钟

    >_<:这是一个时钟小程序 >_<:通过调用获得系统时间然后经过计算得出当前时间,然后再以3个圆环表示时分秒. >_<:TAO_CLOCK.h class CMyA ...

  7. 【关于HBITMAP, DC, MEM DC, Clipboard】将HBITMAP拷贝到Clipboard(Windows Clipboard & OLE Clipboard)

    参考: Programming Windows with MFC, 2nd. Chapter 18, 19. 建议把这两章学习完(至少到OLE drag-and-drop之前要学习完)再来尝试OLE ...

  8. windows类书的学习心得(转载)

    原文网址:http://www.blogjava.net/sound/archive/2008/08/21/40499.html 现在的计算机图书发展的可真快,很久没去书店,昨日去了一下,真是感叹万千 ...

  9. 【转】Windows SDK入门浅谈

    前言 如果你是一个编程初学者,如果你刚刚结束C语言的课程.你可能会有点失望和怀疑:这就是C语言吗?靠它就能编出软件?无法想象Windows桌面上一个普通的窗口是怎样出现在眼前的.从C语言的上机作业到W ...

随机推荐

  1. c#同步上下文SynchronizationContext学习笔记

    提供在各种同步模型中传播同步上下文的基本功能.同步上下文的工作就是确保调用在正确的线程上执行. 同步上下文的基本操作 Current 获取当前同步上下文 var context = Synchroni ...

  2. JAVA文件读取FileReader

    JAVA文件读取FileReader 导包import java.io.FileReader 创建构造方法public FileReader(String filename),参数是文件的路径及文件名 ...

  3. scp---远程拷贝文件

    scp命令用于在Linux下进行远程拷贝文件的命令,和它类似的命令有cp,不过cp只是在本机进行拷贝不能跨服务器,而且scp传输是加密的.可能会稍微影响一下速度.当你服务器硬盘变为只读read onl ...

  4. TaoCode-淘宝的SVN开源托管平台

    无意中发现的..试用了一下,感觉还不错, 简单说一下怎样使用: 进入 http://code.taobao.org/project/explore/ 注冊完后依据提示新建项目,然后在本地随便新建一个文 ...

  5. J2SE基础:2.对象的创建与使用

    1:參数传递的值传递与引用传递 A:值传递:基本数据类型传递都是值传递 B:引用传递(地址传递):对象数据类型都是引用传递. 2:类变量与成员变量(实例变量,对象变量) 类变量:通过类名调用,类变量被 ...

  6. mysql异常Lock wait timeout exceeded; try restarting transaction

    mysql中使用update语句更新数据报错: Lock wait timeout exceeded; try restarting transaction. 这是由于你要更新的表的锁在其它线程手里. ...

  7. 小项目: low版本的 员工信息程序:

    ### 附加两个文件1 user_info 和worker_info flag = False def logon(): #登录函数 global flag usr = input('Username ...

  8. Spark Tachyon的命令行使用

    Tachyon命令行使用 Tachyon接口说明 接口操作示例 copyFromLocal copyToLocal ls和lsr count cat mkdir.rm.rmr和touch pin和un ...

  9. POJ 1742 Coins 优化后的多重背包

    Coins Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 37853   Accepted: 12849 Descripti ...

  10. echo---打印变量或输出字符串

    cho命令用于在shell中打印shell变量的值,或者直接输出指定的字符串.linux的echo命令,在shell编程中极为常用, 在终端下打印变量value的时候也是常常用到的,因此有必要了解下e ...