DDX_Control(pDX, IDC_EDIT2, m_d1);
DDX_Text(pDX, IDC_EDIT1, m_num);
DDX_Text(pDX, IDC_EDIT2, m_d);
DDX_Text(pDX, IDC_EDIT3, m_D);
DDX_Text(pDX, IDC_EDIT4, m_B);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(MyDialog, CDialog)
//{{AFX_MSG_MAP(MyDialog)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// MyDialog message handlers
int MyDialog::DoModal()
{
// TODO: Add your specialized code here and/or call the base class
return CDialog::DoModal();
}
BOOL MyDialog::OnInitDialog()
{
CDialog::OnInitDialog ();
this->GetDlgItem(IDC_EDIT1)->SetWindowText(" ");
this->GetDlgItem(IDC_EDIT2)->SetWindowText(" ");
this->GetDlgItem(IDC_EDIT3)->SetWindowText(" ");
this->GetDlgItem(IDC_EDIT4)->SetWindowText(" ");
return TRUE;
}
显示数据库中的数据窗口如下:
class DGEAR1 : public CDialog
{
// Construction
public:
BOOL OnInitDialog();
void ShowInfo(CString table_name);
void ListCIS();
bool DBAccess(CString strSQL);
DGEAR1(CWnd* pParent = NULL); // standard constructor
CRecordset *m_pset;
CDatabase *m_pdatabase;
int str[7];
// Dialog Data
//{{AFX_DATA(DGEAR1)
enum { IDD = IDD_DIALOG1 };