www.pudn.com > News Search3.01.rar > BeginDlg.cpp
// BeginDlg.cpp : implementation file
//
#include "stdafx.h"
#include "NewSearch.h"
#include "BeginDlg.h"
#include "MainFrm.h"
#include "RegDlg.h"
#include "InputDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CBeginDlg dialog
CBeginDlg::CBeginDlg(CWnd* pParent /*=NULL*/)
: CDialog(CBeginDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CBeginDlg)
//}}AFX_DATA_INIT
m_reg = 0;
}
void CBeginDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CBeginDlg)
DDX_Control(pDX, IDCANCEL, m_cancel);
DDX_Control(pDX, IDC_STATICDAY, m_day);
DDX_Control(pDX, IDC_REGNUM, m_regnum);
DDX_Control(pDX, IDC_REGNOW, m_regnow);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CBeginDlg, CDialog)
//{{AFX_MSG_MAP(CBeginDlg)
ON_BN_CLICKED(IDC_REGNOW, OnRegnow)
ON_BN_CLICKED(IDC_REGNUM, OnRegnum)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBeginDlg message handlers
void CBeginDlg::OnRegnow()
{
// TODO: Add your control notification handler code here
CRegDlg regdlg;
regdlg.DoModal();
m_rtn = regdlg.m_rtn;
if(m_rtn != 0)
SendMessage(WM_CLOSE);
}
void CBeginDlg::OnRegnum()
{
// TODO: Add your control notification handler code here
CInputDlg inputdlg;
m_rtn = inputdlg.DoModal();
// m_rtn = inputdlg.m_rtn;
// if(m_rtn != 0)
// SendMessage(WM_CLOSE);
if(m_rtn == IDOK)
CDialog::OnOK();
else
{
m_rtn = inputdlg.m_rtn;
CDialog::OnCancel();
}
}
BOOL CBeginDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CWinApp* pApp = AfxGetApp();
CString strTotal;
BOOL m_bHasPost = AfxGetApp()->GetProfileInt(_T("Base"),_T("HasPos"),0);
if(m_bHasPost)
m_regnow.ShowWindow(SW_HIDE);
m_day.SetWindowText(m_tips);
if(m_reg == 1)
m_cancel.SetWindowText(_T("Í˳öÈí¼þ(&X)"));
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}