www.pudn.com > virtualListview_demo.zip > NumDlg.cpp


// NumDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "listview_example.h" 
#include "NumDlg.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CNumDlg dialog 
 
 
CNumDlg::CNumDlg(CWnd* pParent /*=NULL*/) 
	: CDialog(CNumDlg::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CNumDlg) 
		// NOTE: the ClassWizard will add member initialization here 
	//}}AFX_DATA_INIT 
	num = 0; 
} 
 
 
void CNumDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CNumDlg) 
	DDX_Control(pDX, IDC_num, m_num); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CNumDlg, CDialog) 
	//{{AFX_MSG_MAP(CNumDlg) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CNumDlg message handlers 
 
void CNumDlg::OnOK()  
{ 
	CString buff; 
	m_num.GetWindowText(buff); 
	num = atoi(buff.GetBuffer(0)); 
 
	if(num <= 0) 
	{ 
		MessageBox("Enter a number larger than 0."); 
		return; 
	} 
 
	CDialog::OnOK(); 
}