16,473
社区成员
发帖
与我相关
我的任务
分享
// Dialog44.cpp : implementation file
//
#include "stdafx.h"
#include "sp.h"
#include "Dialog44.h"
#include "Dialog1.h"
#include "Dialog3.h"
#include <windows.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
MSG msg;
HWND hDialog;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDialog44 dialog
CDialog44::CDialog44(CWnd* pParent /*=NULL*/)
: CDialog(CDialog44::IDD, pParent)
{
//{{AFX_DATA_INIT(CDialog44)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDialog44::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDialog44)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDialog44, CDialog)
//{{AFX_MSG_MAP(CDialog44)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDialog44 message handlers
void CDialog44::OnButton1()
{
// TODO: Add your control notification handler code here
CDialog1 *dlg=new CDialog1,*dlg1=new CDialog1,*dlg2=new CDialog1;
//CDialog44::OnOK();
dlg->Create(IDD_DIALOG1,NULL);
dlg->ShowWindow(SW_SHOW);
dlg1->Create(IDD_DIALOG1,NULL);
dlg1->ShowWindow(SW_SHOW);
dlg2->Create(IDD_DIALOG1,NULL);
dlg2->ShowWindow(SW_SHOW);
while (GetMessage (&msg, NULL, 0, 0))
{
if (hDialog != 0 || !IsDialogMessage (hDialog, &msg))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
}
}
void CDialog44::OnButton2()
{
// TODO: Add your control notification handler code here
CDialog3 *dlg=new CDialog3,*dlg1=new CDialog3,*dlg2=new CDialog3;
//CDialog44::OnOK();
dlg->Create(IDD_DIALOG3,NULL);
dlg->ShowWindow(SW_SHOW);
dlg1->Create(IDD_DIALOG3,NULL);
dlg1->ShowWindow(SW_SHOW);
dlg2->Create(IDD_DIALOG3,NULL);
dlg2->ShowWindow(SW_SHOW);
}
错误在if (hDialog != 0 || !IsDialogMessage (hDialog, &msg))