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

📄 ex07cdialog.cpp

📁 vc.net内幕系列源码
💻 CPP
字号:
// Ex07cDialog.cpp : implementation file
//

#include "stdafx.h"
#include "Ex07c.h"
#include "Ex07cDialog.h"


// CEx07cDialog dialog

IMPLEMENT_DYNAMIC(CEx07cDialog, CDialog)
CEx07cDialog::CEx07cDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CEx07cDialog::IDD, pParent)
	, m_strEdit1(_T(""))
{
	m_pView = NULL;
}

CEx07cDialog::CEx07cDialog(CView* pView)  // modeless constructor
: m_strEdit1(_T(""))
{
    m_pView = pView;
}

CEx07cDialog::~CEx07cDialog()
{
}

void CEx07cDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_EDIT1, m_strEdit1);
}


BEGIN_MESSAGE_MAP(CEx07cDialog, CDialog)
	ON_BN_CLICKED(IDCANCEL, OnBnClickedCancel)
	ON_BN_CLICKED(IDOK, OnBnClickedOk)
END_MESSAGE_MAP()

BOOL CEx07cDialog::Create()
{
    return CDialog::Create(CEx07cDialog::IDD);
}


// CEx07cDialog message handlers

void CEx07cDialog::OnBnClickedCancel()
{
    if (m_pView != NULL) {
        // modeless case -- do not call base class OnCancel
        m_pView->PostMessage(WM_GOODBYE, IDCANCEL);
    }
    else {
        CDialog::OnCancel(); // modal case
    }
}

void CEx07cDialog::OnBnClickedOk()
{
    if (m_pView != NULL) {
        // modeless case -- do not call base class OnOK
        UpdateData(TRUE);
         m_pView->PostMessage(WM_GOODBYE, IDOK);
    }
    else {
        CDialog::OnOK(); // modal case
    }
}

⌨️ 快捷键说明

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