这源代码是书本《visual c++.net MFC 类库应用详解》的
源代码在线查看: connectdialog.cpp
// ConnectDialog.cpp : 实现文件
//
#include "stdafx.h"
#include "Chatter.h"
#include "ConnectDialog.h"
// CConnectDialog 对话框
CConnectDialog::CConnectDialog(CWnd* pParent /*=NULL*/)
: CDialog(CConnectDialog::IDD, pParent)
{
m_nPort = 0;
m_ClientName = _T("");
m_ServerIP = _T("");
}
void CConnectDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_PORT, m_nPort);
DDV_MinMaxInt(pDX, m_nPort, 0, 99);
DDX_Text(pDX, IDC_CLIENTNAME, m_ClientName);
DDV_MaxChars(pDX, m_ClientName, 50);
DDX_Text(pDX, IDC_SERVERIP, m_ServerIP);
DDV_MaxChars(pDX, m_ServerIP, 255);
}
BEGIN_MESSAGE_MAP(CConnectDialog, CDialog)
END_MESSAGE_MAP()
// CConnectDialog 消息处理程序