⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 diver.cpp

📁 《Visual C++ Bible》或者说是《Visual C++ 宝典》的对应的源码文件
💻 CPP
字号:
/* 
 * Diver -- the F8 key starts the debugger and takes you here.
 */
_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
          LPTSTR lpCmdLine, int nCmdShow)
{
    /*
     * Diver -- Innocent macro 
     */
    ASSERT(hPrevInstance == NULL);

    /*
     * Diver -- Place cursor on variable and press Shift-F9
     *          for "Quick Watch" support. See how the value
     *          changes as the instruction is executed. But only
     *          when variable is "in-scope", that is, when
     *          execution control is within function braces.
     */
    int nReturnCode = -1;

    /* 
     *Diver -- Somewhat involved function. Avoid on first dive.
     */
    CWinApp* pApp = AfxGetApp();

    // AFX internal initialization
    /*
     * Diver -- Very involved function, avoid on first dive. But
     *          come back and trace through to see all of the things
     *          that the MFC library does for you to fine-tune
     *          itself to work well with Windows.
     */
    if (!AfxWinInit(hInstance, hPrevInstance, lpCmdLine, nCmdShow))
        goto InitFailure;

    // App global initializations (rare)
                        /*
    ASSERT_VALID(pApp);  * Diver -- Warning! Very complex macro.
                         */
    if (!pApp->InitApplication())  /* Diver -- Simple function. */
        goto InitFailure;
    ASSERT_VALID(pApp);

    // Perform specific initializations
    /*
     * Diver -- Trace into function on first dive by pressing F8 key.
     */
    if (!pApp->InitInstance())
    {
        if (pApp->m_pMainWnd != NULL)
        {
            TRACE0("Warning: Destroying non-NULL m_pMainWnd\n");
            pApp->m_pMainWnd->DestroyWindow();
        }
        nReturnCode = pApp->ExitInstance();
        goto InitFailure;
    }
    ASSERT_VALID(pApp);

    /*
     * Diver -- On later dive, trace into following function to
     *          see message loop and idle-time handling provided
     *          by MFC.
     */
    nReturnCode = pApp->Run();
    ASSERT_VALID(pApp);

InitFailure:
    AfxWinTerm();
    return nReturnCode;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -