Tekkaman

导航

 

CWinApp: The Application Class

   An application built on the framework must have one and only one object of a class derived from CWinApp. This object is constructed before windows are created.

  只能有一个CWinApp对象。

 

  CWinApp is derived from CWinThread, which represents the main thread of execution for your application, which might have one or more threads. In recent versions of MFC, the InitInstanceRunExitInstance, and OnIdlemember functions are actually in class CWinThread

 

  Like any program for the Windows operating system, your framework application has a WinMain function. In a framework application, however, you do not write WinMain. It is supplied by the class library and is called when the application starts up.

  MFC库已经包含了WinMain,不要再自己创建一个WinMain。

 

  To initialize the application, WinMain calls your application object's InitApplication and InitInstance member functions. To run the application's message loop, WinMain calls the Run member function. On termination,WinMain calls the application object's ExitInstance member function.

  实现上述virtual方法来实现功能自定义。

参考:https://msdn.microsoft.com/en-us/library/akdx0603(v=vs.80).aspx

 

posted on 2015-10-03 10:12  Tekkaman  阅读(292)  评论(0编辑  收藏  举报