CWinApp - MSDN6翻译交流

BUG和建议请提出,谢谢!

CWinApp

The CWinApp class is the base class from which you derive a Windows application object. An application object provides member functions for initializing your application (and each instance of it) and for running the application.

CWinApp 类是(用于)派生一个窗口应用物件的基类。一个应用物件提供成员函数,用于初始化应用(及其每一个实例),还用于运转此应用。

Each application that uses the Microsoft Foundation classes can only contain one object derived from CWinApp. This object is constructed when other C++ global objects are constructed and is already available when Windows calls the WinMain function, which is supplied by the Microsoft Foundation Class Library. Declare your derived CWinApp object at the global level.

每一个使用微软基础类的应用,只能包含一个派生自CWinApp 的物件。在其它的C++全局物件被构造时,此物件被构造,并且当视窗调用WinMain函数(由微软基础类库提供)时已经是可用的了。(请)在全局级别声明你的派生的CWinApp物件。

When you derive an application class from CWinApp, override the InitInstance member function to create your application’s main window object.

当你从CWinApp继承一个应用类时,(请)覆盖InitInstance成员函数来创建你的应用的主窗口物件。

In addition to the CWinApp member functions, the Microsoft Foundation Class Library provides the following global functions to access your CWinApp object and other global information:

除了CWinApp的成员函数的,微软基础类库还提供下列全局函数用于访问你的CWinApp物件和其它全局信息。

  • AfxGetApp   Obtains a pointer to the CWinApp object.
  • 获取指向CWinApp物件的指针。
  • AfxGetInstanceHandle   Obtains a handle to the current application instance.
  • 获取当前应用实例的句柄。
  • AfxGetResourceHandle   Obtains a handle to the application’s resources.
  • 获取应用的资源句柄。
  • AfxGetAppName   Obtains a pointer to a string containing the application’s name. Alternately, if you have a pointer to the CWinApp object, use m_pszExeName to get the application’s name.
  • 获取含有应用名称的(字符)串指针,如果你有一个指向CWinApp物件的指针,使用m_pszExeName来获得应用的名称。

See CWinApp: The Application Class in Visual C++ Programmer’s Guide for more on the CWinApp class, including an overview of the following:

  • CWinApp-derived code written by AppWizard.
  • CWinApp’s role in the execution sequence of your application.
  • CWinApp’s default member function implementations.
  • CWinApp’s key overridables.

#include <afxwin.h>

Class MembersBase ClassHierarchy Chart

Samples    MFC Sample HELLOAPPMFC Sample HELLO

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值