zoukankan      html  css  js  c++  java
  • programming+windows+MFC

    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 un exitinstancepretranslatemessage

    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:

  • 相关阅读:
    手把手教您玩转信用卡 如何“以卡养卡”合法“套现”
    267家已获第三方许可机构名单查询
    C#生成图片验证码
    File I/O
    文件上传代码
    集合框架
    接口
    多态
    封装
    jsp做成mvc模式的代码
  • 原文地址:https://www.cnblogs.com/gosteps/p/3317732.html
Copyright © 2011-2022 走看看