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:

  • 相关阅读:
    codevs 1069关押罪犯
    codevs 1497取余运算
    codevs 3324 新斯诺克
    codevs 3286 火柴排队
    继续畅通工程
    还是畅通工程
    畅通工程(并查集找根节点)
    Eddy's picture(最小生成树)
    Constructing Roads(最小生成树)
    Codeforces Round #383 (Div. 2)C. Arpa's loud Owf and Mehrdad's evil plan
  • 原文地址:https://www.cnblogs.com/gosteps/p/3317732.html
Copyright © 2011-2022 走看看