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

📄 aframe.cpp

📁 《Visual C++ Bible》或者说是《Visual C++ 宝典》的对应的源码文件
💻 CPP
字号:
// AFRAME.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "AFRAME.h"

#include "mainfrm.h"
// #include "doc.h"  // Remove Doc/View support [ply]
// #include "view.h" // Remove Doc/View support [ply]

#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////
// DApp

BEGIN_MESSAGE_MAP(DApp, CWinApp)
    //{{AFX_MSG_MAP(DApp)
    ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
        // NOTE - ClassWizard adds and remove mapping macros here.
        //    DO NOT EDIT these blocks of generated code!
    //}}AFX_MSG_MAP
    // Standard file based document commands
    // ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
    // ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////
// DApp construction

DApp::DApp()
{
    // TODO: add construction code here,
    // Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////
// The one and only DApp object

DApp theApp;

/////////////////////////////////////////////////////////////////////
// DApp initialization

BOOL DApp::InitInstance()
{

/*  // BEGIN: Remove Doc/View support

    // Standard initialization
    // If you are not using these features and wish to reduce the size
    //  of your final executable, you should remove from the following
    //  the specific initialization routines you do not need.

    LoadStdProfileSettings(); // Load standard INI file options (including MRU)

    // Register the application's document templates.  Document templates
    //  serve as the connection between documents, frame windows and views.

    CSingleDocTemplate* pDocTemplate;
    pDocTemplate = new CSingleDocTemplate(
        IDR_MAINFRAME,
        RUNTIME_CLASS(Doc),
        RUNTIME_CLASS(DMainFrame),       // main SDI frame window
        RUNTIME_CLASS(View));
    AddDocTemplate(pDocTemplate);

    // create a new (empty) document
    OnFileNew();

    if (m_lpCmdLine[0] != '\0')
    {
        // TODO: add command line processing here
    }

*/  // END: Remove Doc/View support

    // Step 1: Allocate C++ window object.
    DMainFrame * pFrame;
    pFrame = new DMainFrame();

    // Step 2: Initialize window object.
    pFrame->LoadFrame(IDR_MAINFRAME);

    // Make window visible
    pFrame->ShowWindow(m_nCmdShow);

    // Assign frame as application's main window
    m_pMainWnd = pFrame;

    return TRUE;
}

/////////////////////////////////////////////////////////////////////
// DAboutDlg dialog used for App About

class DAboutDlg : public CDialog
{
public:
    DAboutDlg();

// Dialog Data
    //{{AFX_DATA(DAboutDlg)
    enum { IDD = IDD_ABOUTBOX };
    //}}AFX_DATA

// Implementation
protected:
    virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
    //{{AFX_MSG(DAboutDlg)
        // No message handlers
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
};

DAboutDlg::DAboutDlg() : CDialog(DAboutDlg::IDD)
{
    //{{AFX_DATA_INIT(DAboutDlg)
    //}}AFX_DATA_INIT
}

void DAboutDlg::DoDataExchange(CDataExchange* pDX)
{
    CDialog::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(DAboutDlg)
    //}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(DAboutDlg, CDialog)
    //{{AFX_MSG_MAP(DAboutDlg)
        // No message handlers
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()

// App command to run the dialog
void DApp::OnAppAbout()
{
    DAboutDlg aboutDlg;
    aboutDlg.DoModal();
}

/////////////////////////////////////////////////////////////////////
// DApp commands

⌨️ 快捷键说明

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