testserverdlg.cpp

来自「《Windows应用程序捆绑核心编程》配套源码」· C++ 代码 · 共 70 行

CPP
70
字号
// TestServerDlg.cpp : implementation file
//

#include "stdafx.h"
#include "TestServer.h"
#include "TestServerDlg.h"

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


/////////////////////////////////////////////////////////////////////////////
// CTestServerDlg dialog

CTestServerDlg::CTestServerDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CTestServerDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CTestServerDlg)
	m_strPointer = _T("");
	m_strValue = _T("");
	//}}AFX_DATA_INIT

	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CTestServerDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CTestServerDlg)
	DDX_Text(pDX, IDC_VAR_POINTER, m_strPointer);
	DDX_Text(pDX, IDC_VAR_VALUE, m_strValue);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CTestServerDlg, CDialog)
	//{{AFX_MSG_MAP(CTestServerDlg)
	ON_WM_TIMER()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTestServerDlg message handlers

BOOL CTestServerDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	
	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	SetTimer(1,900,NULL);
	m_dwValue=20060901;  
    
	return TRUE;  // return TRUE  unless you set the focus to a control.
}

void CTestServerDlg::OnTimer(UINT nIDEvent) 
{
    m_strPointer.Format("0x%x",&m_dwValue);
    m_strValue.Format("%d",m_dwValue);
	UpdateData(FALSE);

	CDialog::OnTimer(nIDEvent);
}

⌨️ 快捷键说明

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