什么情况下dialog会创建失败
调用:
CMapDlg map;
map.DoModal();
INT_PTR nRect = map.DoModal();
DWORD dw = GetLastError();
nRect等于-1,dw等于0
CMapDlg使用向导生成。
// MapDlg.cpp : implementation file
//
#include "stdafx.h"
#include "MapDll.h"
#include "MapDlg.h"
#include ".\mapdlg.h"
// CMapDlg dialog
IMPLEMENT_DYNAMIC(CMapDlg, CDialog)
CMapDlg::CMapDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMapDlg::IDD, pParent)
{
}
CMapDlg::~CMapDlg()
{
}
void CMapDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_RICHEDIT21, m_richEdit);
}
BEGIN_MESSAGE_MAP(CMapDlg, CDialog)
END_MESSAGE_MAP()
// CMapDlg message handlers
BOOL CMapDlg::OnInitDialog()
{
CDialog::OnInitDialog();
AfxMessageBox("Initial Dialog");
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CMapDlg::OnOK()
{
// TODO: Add your specialized code here and/or call the base class
AfxMessageBox("on ok");
CDialog::OnOK();
}