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. Oracle数据库IP访问限制(IP白名单黑名单)

    1.编辑sqlnet.ora 内容为: #允许访问的IP(白名单) TCP.INVITED_NODES=(127.0.0.1,192.168.56.109,ip2,ip3,..,..本地IP..)若使 ...

  2. 常用sql语句及案例

    目录 1)基本 2)数学函数 3)rownum 4)分页 5)时间处理 6)字符函数 7)to_number 8)聚合函数 9)学生选课 10)图书馆借阅 基本 --新建表: create table ...

  3. Redux 总结

    1.redux: function reducer(state=-,action) { switch(action.type) { case '': return ... case '': retur ...

  4. PXE无人值守部署centos7.4操作系统

    1.基础环境: 镜像ISO文件名为:CentOS-7-x86_64-DVD-1804.iso 2.安装需要的软件包 yum install dhcp xinetd syslinux httpd tft ...

  5. 直接修改Android软件数据库来改变软件设置实例一则

    昨天把K860i刷了机,刷到了最新的CyanogenMod 10.1,使用起来各种流畅舒服,不过却由于内外置SD卡的挂载点的改变,造成了一些困扰,现记录如下.         平时里由于极少把手机连接 ...

  6. XTUOJ 1206 Dormitory's Elevator

    Dormitory's Elevator Time Limit : 1000 MS   Memory Limit : 65536 KB Problem Description The new dorm ...

  7. Python入门:全站url爬取

    <p>作为一个安全测试人员,面对一个大型网站的时候,手工测试很有可能测试不全,这时候就非常需要一个通用型的网站扫描器.当然能直接扫出漏洞的工具也有很多,但这样你只能算是一个工具使用者,对于 ...

  8. 洛谷 P2080 增进感情

    P2080 增进感情 题目背景 小明和小红的感情,是慢慢发展起来的. 题目描述 他们对对方分别有一个好感值.定义两人的亲密程度为两人的好感值之和. 如果他们的亲密程度达到V,则他们将走到一起.他们以后 ...

  9. 洛谷 P2558 [AHOI2002]网络传输

    P2558 [AHOI2002]网络传输 题目描述 在计算机网络中所有数据都是以二进制形式来传输的. 但是在进行较大数据的传输时,直接使用该数的二进制形式加以传输则往往传输的位数过多. 譬如要传输 1 ...

  10. win7中下mysql-5.6.22免安装配置

    windows下mysql免安装配置 1. 下载mysql免安装压缩包 下载mysql-5.6.22-winx64.zip 解压到本地D:\mysql-5.6.22-winx64 2. 修改配置文件 ...