﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-bullGao-随笔分类-VC++</title><link>http://www.cppblog.com/bestgz/category/3140.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 20 May 2008 11:23:55 GMT</lastBuildDate><pubDate>Tue, 20 May 2008 11:23:55 GMT</pubDate><ttl>60</ttl><item><title>消息循环</title><link>http://www.cppblog.com/bestgz/archive/2006/12/11/16270.html</link><dc:creator>bullGao</dc:creator><author>bullGao</author><pubDate>Mon, 11 Dec 2006 07:00:00 GMT</pubDate><guid>http://www.cppblog.com/bestgz/archive/2006/12/11/16270.html</guid><wfw:comment>http://www.cppblog.com/bestgz/comments/16270.html</wfw:comment><comments>http://www.cppblog.com/bestgz/archive/2006/12/11/16270.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bestgz/comments/commentRss/16270.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bestgz/services/trackbacks/16270.html</trackback:ping><description><![CDATA[
		<p>Windows应用程序的运行以消息为核心，Windows将产生的消息放入应用程序的消息队列中，而应用程序WinMain函数的消息循环提取队列中的消息，并将信息传给窗口函数的相应过程。</p>
		<p>消息循环的常见格式如下：</p>
		<p>MSG Msg;</p>
		<p>...</p>
		<p>while ( GetMessage( &amp;Msg, NULL, 0, 0 ) )</p>
		<blockquote>
				<p>{</p>
				<p>TranslateMessage( &amp;Msg );</p>
				<p>DispatchMessage( &amp;Msg );</p>
				<p>}</p>
		</blockquote>
		<p>其中函数GetMessage的作用是从消息队列中读取一条信息，并将信息放在一个MSG结构中，其形式为：</p>
		<p>GetMassage</p>
		<blockquote>
				<p>( lpMSG, </p>
				<p>  hwnd,</p>
				<p>  nMsgFilterMin,</p>
				<p>  nMsgFilterMax</p>
				<p>)</p>
		</blockquote>
		<p>值得注意的是，GetMessage函数中的参数nMsgFilterMin和nMsgFilterMax可实现对消息的过滤，即程序仅处理所确定的消息号范围内的消息，如果两个参数都为0，则不过滤消息。</p>
		<p>TranslateMessag函数负责将消息的虚拟间转换为字符信息，其形式为：</p>
		<p>TranslateMessage( lpMSG )</p>
		<p>DispatchMessage函数将参数lpMSG指向的消息传送到指定窗口函数，其形式为：</p>
		<p>DispatchMessage( lpMSG )</p>
		<p>当GetMessage函数返回零值，检索到WM_QUIT时，程序将结束循环并退出。</p>
<img src ="http://www.cppblog.com/bestgz/aggbug/16270.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bestgz/" target="_blank">bullGao</a> 2006-12-11 15:00 <a href="http://www.cppblog.com/bestgz/archive/2006/12/11/16270.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>面向对象程序设计中的一些复杂数据结构</title><link>http://www.cppblog.com/bestgz/archive/2006/12/11/16267.html</link><dc:creator>bullGao</dc:creator><author>bullGao</author><pubDate>Mon, 11 Dec 2006 06:34:00 GMT</pubDate><guid>http://www.cppblog.com/bestgz/archive/2006/12/11/16267.html</guid><wfw:comment>http://www.cppblog.com/bestgz/comments/16267.html</wfw:comment><comments>http://www.cppblog.com/bestgz/archive/2006/12/11/16267.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bestgz/comments/commentRss/16267.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bestgz/services/trackbacks/16267.html</trackback:ping><description><![CDATA[
		<p>
		</p>
		<h1>
				<span style="COLOR: #0000ff">
						<font color="#000000">WNDCLASS</font>
				</span>
		</h1>
		<pre>
				<span style="COLOR: #0000ff">typedef </span>
				<font color="#0000ff">struc<span style="COLOR: #0000ff">t</span></font> _WNDCLASS { 
    UINT    style; 		<span style="COLOR: #008000">//窗口类样式</span>
    WNDPROC lpfnWndProc; 	<span style="COLOR: #008000">//指向窗口函数的指针</span><span style="COLOR: #0000ff">int</span>     cbClsExtra; 	<span style="COLOR: #008000">//分配在窗口类结构后的字节数</span><span style="COLOR: #0000ff">int</span>     cbWndExtra; 	<span style="COLOR: #008000">//分配在窗口实例后的字节数</span>
    HANDLE  hInstance; 		<span style="COLOR: #008000">//定义窗口类的应用程序的实力句柄</span>
    HICON   hIcon; 		<span style="COLOR: #008000">//窗口类的图标</span>
    HCURSOR hCursor; 		<span style="COLOR: #008000">//窗口类的光标</span>
    HBRUSH  hbrBackground; 	<span style="COLOR: #008000">//窗口类的背景刷</span>
    LPCTSTR lpszMenuName; 	<span style="COLOR: #008000">//窗口类菜单资源</span>
    LPCTSTR lpszClassName; 	<span style="COLOR: #008000">//窗口类名</span>
} WNDCLASS; </pre>
		<pre> </pre>
		<pre> </pre>
		<h3>Members</h3>
		<dl>
				<dt>
						<b>style</b>
				</dt>
				<dd>Specifies the class style(s). Styles can be combined by using the bitwise OR (|) operator. This member can be any combination of the following values: 
<p><b>Value</b><br />Action </p><p>CS_BYTEALIGNCLIENT<br />Aligns the window's client area on the byte boundary (in the x direction). This style affects the width of the window and its horizontal position on the display. </p><p>CS_BYTEALIGNWINDOW<br />Aligns a window on a byte boundary (in the x direction). This style affects the width of the window and its horizontal position on the display. </p><p>CS_CLASSDC<br />Allocates one device context to be shared by all windows in the class. Because window classes are process specific, it is possible for multiple threads of an application to create a window of the same class. It is also possible for the threads to attempt to use the device context simultaneously. When this happens, the system allows only one thread to successfully finish its drawing operation. For more information, see <a href="JavaScript:alink_1.Click()">Device Contexts</a>. </p><p>CS_DBLCLKS<br />Sends double-click messages to the window procedure when the user double-clicks the mouse while the cursor is within a window belonging to the class. </p><p>CS_GLOBALCLASS<br />Allows an application to create a window of the class regardless of the value of the <i>hInstance</i> parameter passed to the <a href="windows_33jr.htm"><b>CreateWindow</b></a> or <a href="windows_1w6w.htm"><b>CreateWindowEx</b></a> function. If you do not specify this style, the <i>hInstance</i> parameter passed to the <b>CreateWindow</b> (or <b>CreateWindowEx</b>) function must be the same as the <i>hInstance</i> parameter passed to the <a href="winclass_70s3.htm"><b>RegisterClass</b></a> function. </p><p>You can create a global class by creating the window class in a dynamic-link library (DLL) and listing the name of the DLL in the registry under the following keys: </p><p><b>HKEY_LOCAL_MACHINE</b>\<b>Software<br /></b>\<b>Microsoft</b>\<b>Windows NT</b>\<br /><b>CurrentVersion</b>\<b>Windows</b>\<b>AppInit_DLLs</b></p><p>Whenever a process starts, the system loads the specified DLLs in the context of the newly started process before calling the entry-point function in that process. The DLL must register the class during its initialization procedure and must specify the CS_GLOBALCLASS style. </p><p>CS_HREDRAW<br />Redraws the entire window if a movement or size adjustment changes the width of the client area. </p><p>CS_NOCLOSE<br />Disables <b>Close</b> on the <b>window</b> menu. </p><p>CS_OWNDC<br />Allocates a unique device context for each window in the class. </p><p>CS_PARENTDC<br />Sets the clipping region of the child window to that of the parent window so that the child can draw on the parent. A window with the CS_PARENTDC style bit receives a regular device context from the system's cache of device contexts. It does not give the child the parent's device context or device context settings. Specifying CS_PARENTDC enhances an application's performance. For more information, see <a href="JavaScript:alink_2.Click()">Device Contexts</a>. </p><p>CS_SAVEBITS<br />Saves, as a bitmap, the portion of the screen image obscured by a window. The system uses the saved bitmap to re-create the screen image when the window is removed. The system displays the bitmap at its original location and does not send <a href="JavaScript:alink_3.Click()">WM_PAINT</a> messages to windows obscured by the window if the memory used by the bitmap has not been discarded and if other screen actions have not invalidated the stored image. This style is useful for small windows (for example, menus or dialog boxes) that are displayed briefly and then removed before other screen activity takes place. This style increases the time required to display the window, because the system must first allocate memory to store the bitmap. </p><p>CS_VREDRAW<br />Redraws the entire window if a movement or size adjustment changes the height of the client area. </p><p></p></dd>
				<dt>
						<b>lpfnWndProc</b>
				</dt>
				<dd>Pointer to the window procedure. You must use the <a href="winprocs_9dlv.htm"><b>CallWindowProc</b></a> function to call the window procedure. For more information, see <a href="winprocs_53xf.htm"><b>WindowProc</b></a>. 
</dd>
				<dt>
						<b>cbClsExtra</b>
				</dt>
				<dd>Specifies the number of extra bytes to allocate following the window-class structure. The system initializes the bytes to zero. 
</dd>
				<dt>
						<b>cbWndExtra</b>
				</dt>
				<dd>Specifies the number of extra bytes to allocate following the window instance. The system initializes the bytes to zero. If an application uses <b>WNDCLASS</b> to register a dialog box created by using the <b>CLASS</b> directive in the resource file, it must set this member to DLGWINDOWEXTRA. 
</dd>
				<dt>
						<b>hInstance</b>
				</dt>
				<dd>Handle to the instance that the window procedure of this class is within. 
</dd>
				<dt>
						<b>hIcon</b>
				</dt>
				<dd>Handle to the class icon. This member must be a handle of an icon resource. If this member is NULL, an application must draw an icon whenever the user minimizes the application's window. 
</dd>
				<dt>
						<b>hCursor</b>
				</dt>
				<dd>Handle to the class cursor. This member must be a handle of a cursor resource. If this member is NULL, an application must explicitly set the cursor shape whenever the mouse moves into the application's window. 
</dd>
				<dt>
						<b>hbrBackground</b>
				</dt>
				<dd>Handle to the class background brush. This member can be a handle to the physical brush to be used for painting the background, or it can be a color value. A color value must be one of the following standard system colors (the value 1 must be added to the chosen color). If a color value is given, you must convert it to one of the following <b>HBRUSH</b> types: 
<p>COLOR_ACTIVEBORDER<br />COLOR_ACTIVECAPTION<br />COLOR_APPWORKSPACE<br />COLOR_BACKGROUND<br />COLOR_BTNFACE<br />COLOR_BTNSHADOW<br />COLOR_BTNTEXT<br />COLOR_CAPTIONTEXT<br />COLOR_GRAYTEXT<br />COLOR_HIGHLIGHT<br />COLOR_HIGHLIGHTTEXT<br />COLOR_INACTIVEBORDER<br />COLOR_INACTIVECAPTION<br />COLOR_MENU<br />COLOR_MENUTEXT<br />COLOR_SCROLLBAR<br />COLOR_WINDOW<br />COLOR_WINDOWFRAME<br />COLOR_WINDOWTEXT </p><p>The system automatically deletes class background brushes when the class is freed. An application should not delete these brushes, because a class may be used by multiple instances of an application. </p><p>When this member is NULL, an application must paint its own background whenever it is requested to paint in its client area. To determine whether the background must be painted, an application can either process the WM_ERASEBKGND message or test the <b>fErase</b> member of the <a href="JavaScript:alink_4.Click()"><b>PAINTSTRUCT</b></a> structure filled by the <a href="JavaScript:alink_5.Click()"><b>BeginPaint</b></a> function. </p><p></p></dd>
				<dt>
						<b>lpszMenuName</b>
				</dt>
				<dd>Pointer to a null-terminated character string that specifies the resource name of the class menu, as the name appears in the resource file. If you use an integer to identify the menu, use the <a href="resource_2dd1.htm"><b>MAKEINTRESOURCE</b></a> macro. If this member is NULL, windows belonging to this class have no default menu. 
</dd>
				<dt>
						<b>lpszClassName</b>
				</dt>
				<dd>Pointer to a null-terminated string or is an atom. If this parameter is an atom, it must be a global atom created by a previous call to the <b>GlobalAddAtom</b> function. The atom, a 16-bit value, must be in the low-order word of <b>lpszClassName</b>; the high-order word must be zero. 
<p>If <b>lpszClassName</b> is a string, it specifies the window class name. </p></dd>
		</dl>
		<p>
		</p>
		<h2>MSG</h2>
		<p>The <b>MSG</b> structure contains message information from a thread's message queue. </p>
		<p> </p>
		<pre>
				<span style="COLOR: #0000ff">typedef </span>
				<span style="COLOR: #0000ff">struct</span> tagMSG {     <span style="COLOR: #008000">// msg </span>
    HWND   hwnd;     
    UINT   message; 
    WPARAM wParam; 
    LPARAM lParam; 
    DWORD  time; 
    POINT  pt; 
} MSG;</pre>
		<p>
		</p>
		<h3>Members</h3>
		<dl>
				<dt>
						<b>hwnd</b>
				</dt>
				<dd>Handle to the window whose window procedure receives the message. 
</dd>
				<dt>
						<b>message</b>
				</dt>
				<dd>Specifies the message number. 
</dd>
				<dt>
						<b>wParam</b>
				</dt>
				<dd>Specifies additional information about the message. The exact meaning depends on the value of the <b>message</b> member. 
</dd>
				<dt>
						<b>lParam</b>
				</dt>
				<dd>Specifies additional information about the message. The exact meaning depends on the value of the <b>message</b> member. 
</dd>
				<dt>
						<b>time</b>
				</dt>
				<dd>Specifies the time at which the message was posted. 
</dd>
				<dt>
						<b>pt</b>
				</dt>
				<dd>Specifies the cursor position, in screen coordinates, when the message was posted. </dd>
		</dl>
		<p> </p>
		<p> </p>
		<h2>
				<a>
				</a>POINT Structure</h2>
		<p>The <b>POINT</b> data structure has the following form: </p>
		<p> </p>
		<pre>
				<span style="COLOR: #0000ff">typedef</span>
				<span style="COLOR: #0000ff">struct</span> tagPOINT {
   LONG x;
   LONG y;
} POINT;
</pre>
		<p>
		</p>
		<p>The <b>POINT</b> structure defines the x<i>-</i> and y-coordinates of a point. </p>
		<p>
				<b>Members</b>
		</p>
		<p>
				<b>x</b>
		</p>
		<p>Specifies the x-coordinate of a point. </p>
		<p>
				<b>y</b>
		</p>
		<p>Specifies the y-coordinate of a point. </p>
		<p>
		</p>
		<p>
		</p>
		<h2>
				<a>
				</a>
				<sup>
				</sup>RECT Structure</h2>
		<p>The <b>RECT</b> data structure has the following form: </p>
		<p> </p>
		<pre>
				<span style="COLOR: #0000ff">typedef</span>
				<span style="COLOR: #0000ff">struct</span> tagRECT {
   LONG left;
   LONG top;
   LONG right;
   LONG bottom;
} RECT;
</pre>
		<p>
		</p>
		<p>The <b>RECT</b> structure defines the coordinates of the upper-left and lower-right corners of a rectangle. </p>
		<h3>
				<b>Members</b>
		</h3>
		<p>
				<b>left</b>
		</p>
		<p>Specifies the x-coordinate of the upper-left corner of a rectangle. </p>
		<p>
				<b>top</b>
		</p>
		<p>Specifies the y-coordinate of the upper-left corner of a rectangle. </p>
		<p>
				<b>right</b>
		</p>
		<p>Specifies the x-coordinate of the lower-right corner of a rectangle. </p>
		<p>
				<b>bottom</b>
		</p>
		<p>Specifies the y-coordinate of the lower-right corner of a rectangle.</p>
<img src ="http://www.cppblog.com/bestgz/aggbug/16267.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bestgz/" target="_blank">bullGao</a> 2006-12-11 14:34 <a href="http://www.cppblog.com/bestgz/archive/2006/12/11/16267.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>common data types in MFC</title><link>http://www.cppblog.com/bestgz/archive/2006/12/11/16259.html</link><dc:creator>bullGao</dc:creator><author>bullGao</author><pubDate>Sun, 10 Dec 2006 18:50:00 GMT</pubDate><guid>http://www.cppblog.com/bestgz/archive/2006/12/11/16259.html</guid><wfw:comment>http://www.cppblog.com/bestgz/comments/16259.html</wfw:comment><comments>http://www.cppblog.com/bestgz/archive/2006/12/11/16259.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bestgz/comments/commentRss/16259.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bestgz/services/trackbacks/16259.html</trackback:ping><description><![CDATA[
		<p>
		</p>
		<h3>
				<a>
				</a>Data Types</h3>
		<p>This topic lists the data types most commonly used in the Microsoft Foundation Class Library. Most of the data types are exactly the same as those in the Windows Software Development Kit (SDK), while others are unique to MFC. 
</p>
		<p>Commonly used Windows SDK and MFC data types are as follows: 
</p>
		<ul>
				<li>
						<b>BOOL</b>   A Boolean value. 
</li>
				<li>
						<b>BSTR</b>   A 32-bit character pointer. 
</li>
				<li>
						<b>BYTE</b>   An 8-bit integer that is not signed. 
</li>
				<li>
						<b>COLORREF</b>   A 32-bit value used as a color value. 
</li>
				<li>
						<b>DWORD</b>   A 32-bit unsigned integer or the address of a segment and its associated offset. 
</li>
				<li>
						<b>LONG</b>   A 32-bit signed integer. 
</li>
				<li>
						<b>LPARAM</b>   A 32-bit value passed as a parameter to a window procedure or callback function. 
</li>
				<li>
						<b>LPCSTR</b>   A 32-bit pointer to a constant character string. 
</li>
				<li>
						<b>LPSTR</b>   A 32-bit pointer to a character string. 
</li>
				<li>
						<b>LPCTSTR</b>   A 32-bit pointer to a constant character string that is portable for Unicode and DBCS. 
</li>
				<li>
						<b>LPTSTR</b>   A 32-bit pointer to a character string that is portable for Unicode and DBCS. 
</li>
				<li>
						<b>LPVOID</b>   A 32-bit pointer to an unspecified type. 
</li>
				<li>
						<b>LRESULT</b>   A 32-bit value returned from a window procedure or callback function. 
</li>
				<li>
						<b>UINT</b>   A 16-bit unsigned integer on Windows versions 3.0 and 3.1; a 32-bit unsigned integer on Win32. 
</li>
				<li>
						<b>WNDPROC</b>   A 32-bit pointer to a window procedure. 
</li>
				<li>
						<b>WORD</b>   A 16-bit unsigned integer. 
</li>
				<li>
						<b>WPARAM</b>   A value passed as a parameter to a window procedure or callback function: 16 bits on Windows versions 3.0 and 3.1; 32 bits on Win32. </li>
		</ul>
		<p>Data types unique to the Microsoft Foundation Class Library include the following: 
</p>
		<ul>
				<li>
						<b>POSITION</b>   A value used to denote the position of an element in a collection; used by MFC collection classes. 
</li>
				<li>
						<b>LPCRECT</b>   A 32-bit pointer to a constant (nonmodifiable) <b>RECT</b> structure. </li>
		</ul>
<img src ="http://www.cppblog.com/bestgz/aggbug/16259.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bestgz/" target="_blank">bullGao</a> 2006-12-11 02:50 <a href="http://www.cppblog.com/bestgz/archive/2006/12/11/16259.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MFC工程里面的一些文档</title><link>http://www.cppblog.com/bestgz/archive/2006/11/29/15800.html</link><dc:creator>bullGao</dc:creator><author>bullGao</author><pubDate>Wed, 29 Nov 2006 15:37:00 GMT</pubDate><guid>http://www.cppblog.com/bestgz/archive/2006/11/29/15800.html</guid><wfw:comment>http://www.cppblog.com/bestgz/comments/15800.html</wfw:comment><comments>http://www.cppblog.com/bestgz/archive/2006/11/29/15800.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bestgz/comments/commentRss/15800.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bestgz/services/trackbacks/15800.html</trackback:ping><description><![CDATA[
		<div>StdAfx.h 是Visual C++工程的预编译头文件，将一些常用的并且很少需要修改的头文件放入StdAfx.h中可以有效提高VC++的编译速度。</div>
		<div> </div>
		<div>Resourse.h中包含了对程序和资源中所用到的常量的定义。</div>
		<div>
				<br />xxxx.h：该文件是应用程序的主要文件，其中定义了应用程序类CxxxxApp。在MFC中，应用程序封装了一个windows应用程序的初始化、运行和终止。每一个MFC应用程序都必须包括一个从<font color="#ff0000">CWinApp</font>派生的应用程序类，在应用程序xxxx中，这个类就是CxxxxApp。这个对象在窗口被创造之前进行构造。类CWinApp从类<font color="#ff0000">CWinThread</font>派生，它代表了应用程序的主执行线程。<br /></div>
		<div>
				<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
						<span style="COLOR: #000000">CMfctestApp::CMfctestApp()<br />{<br />    </span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000"> TODO: add construction code here,<br />    </span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000"> Place all significant initialization in InitInstance</span>
						<span style="COLOR: #008000">
								<br />
						</span>
						<span style="COLOR: #000000">}</span>
				</div>
				<br />在MFC程序设计中，WinMain函数是由<font style="BACKGROUND-COLOR: #ffffff" color="#ff0000">类库</font>提供的，它在应用程序启动时被调用。WinMain函数执行如 <em><u>注册窗口类 </u></em>之类的标准服务，接着它调用应用程序对象的成员函数来初始化并且运行应用程序。通过重载WinMain函数所调用的类CWinApp的成员函数可以自定义WinMain函数。<br /><br /><strong>NOTE</strong>：由于在Win32环境下，每一个应用程序的事例都是独立的，它们有着自己的虚拟地址空间，因此，在目前版本MFC中，成员函数CWinApp::InitApplication已被废弃，原来在InitApplication中进行的初始化操作应该移到<font color="#ff0000">InitInstance</font>中进行。<br /><br />由AppWizard生成的基于对话框应用程序提供了对InitInstance的默认重载，也正是在该成员函数中提供了基于对话框的应用程序的特点。在MFC中，无论是基于对话框的应用程序，还是基于文档/视结构的应用程序，它们的应用程序对象都是从CWinApp派生来的，它们之间的功能的巨大差异，往往就是通过类CWinApp的成员函数进行不同的重载来实现的。<br />在每一个同一应用程序的实例被启动时，WinMain函数调用一次InitInstance成员函数。原有的InitApplication不再有意义，每一个应用程序的实例都被认为是独立的，对应用程序的初始化于对实例的初始化没有本质区别。对于InitInstance成员函数，它在当应用程序进行初始化的时候由WinMain函数调用。</div>
<img src ="http://www.cppblog.com/bestgz/aggbug/15800.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bestgz/" target="_blank">bullGao</a> 2006-11-29 23:37 <a href="http://www.cppblog.com/bestgz/archive/2006/11/29/15800.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>