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

📄 dlg2.cpp

📁 本事例:帮助理解MFC窗口通信全局变量的使用
💻 CPP
字号:
// dlg2.cpp : implementation file
//

#include "stdafx.h"
#include "testmb.h"
#include "dlg2.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// dlg2 dialog


dlg2::dlg2(CWnd* pParent /*=NULL*/)
	: CDialog(dlg2::IDD, pParent)
{
	//{{AFX_DATA_INIT(dlg2)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void dlg2::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(dlg2)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(dlg2, CDialog)
	//{{AFX_MSG_MAP(dlg2)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// dlg2 message handlers

void dlg2::OnButton1() 
{
	// TODO: Add your control notification handler code here
	
	CTestmbApp *app = (CTestmbApp *)AfxGetApp(); //生成指向应用程序类的指针 
	app->testStr = "dlg2::OnButton1()";
	
	MessageBox(app->testStr);
	
	


}

⌨️ 快捷键说明

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