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. Linux 如何重新划分Swap交换分区

    SWAP分区是LINUX暂时存储数据的交换分区,它主要是把主内存上暂时不用得数据存起来,在需要的时候再调进内存内,且作为SWAP使用的分区不用指定“MoutPoint”(载入点)它至少要等于系统上实际 ...

  2. js图表插件绘制各种类型图表

    官网:http://www.bootcss.com/p/chart.js/ 中文参考手册:http://www.bootcss.com/p/chart.js/docs/ 一.生成折线图 :test.h ...

  3. HDU 4431 Mahjong 模拟

    http://acm.hdu.edu.cn/showproblem.php?pid=4431 不能说是水题了,具体实现还是很恶心的...几乎优化到哭但是DFS(还加了几个剪枝)还是不行...搜索一直T ...

  4. GridView单元格取值显示为&nbsp;

    在通过GridView取一个单元格(cell)的值时,数据库中为NULL,而页面上显示为空格.发现通过gridview.cell[i].text取出来的值为 ,导致获取数据出现问题. 解决方法: 一. ...

  5. 对比《动手学深度学习》 PDF代码+《神经网络与深度学习 》PDF

    随着AlphaGo与李世石大战的落幕,人工智能成为话题焦点.AlphaGo背后的工作原理"深度学习"也跳入大众的视野.什么是深度学习,什么是神经网络,为何一段程序在精密的围棋大赛中 ...

  6. 控制div固定在页面的某个位置 ,用js感觉很麻烦 CSS更好一些

    CSS代码:<style type="text/css"> html,body { width:100%; height:100%; margin:0px; paddi ...

  7. 【Swift初见】Swift数组(二)

    在苹果的开发文档中对Array还提供了其它的操作算法: 1.Sort函数: 对数组进行排序.依据指定的排序规则,看以下的代码: var array = [2, 3, 4, 5] array.sort{ ...

  8. POJ 2138 最长路

    思路: 如果j能由i得到 则i向j连一条边 答案就是最长路的末节点所代表的string //By SiriusRen #include <cstdio> #include <cstr ...

  9. POJ 1991 DP

    题意: 思路: 考虑DP 先把事件按照地点顺序排个序 f[i][j][0]表示从i到j还没有去过 现在在i f[i][j][1]表示从i到j还没有去过 现在在j 那么方程就呼之欲出了 f[i][j][ ...

  10. CDQZ 0003:jubeeeeeat

    0003:jubeeeeeat 查看 提交 统计 提问 总时间限制:  1000ms 内存限制:  256000kB 描述 众所周知,LZF很喜欢打一个叫Jubeat的游戏.这是个音乐游戏,游戏界面是 ...