在不使用对话框指针的情况下创建对话框

Modles dialog creation without using dialog pointer

本文关键字:对话框 情况下 创建 指针      更新时间:2023-10-16

为什么下面的第二行代码会出现异常

StatusDlg statusDlg (CWnd::GetDesktopWindow());
statusDlg.ShowWindow(SW_SHOW);

下面的代码没有问题

StatusDlg * statusDlg = new StatusDlg(NULL);
statusDlg->Create(StatusDlg::IDD,CWnd::GetDesktopWindow());
statusDlg->ShowWindow(SW_SHOW)

因为第一个剂量没有创建对话框的基础窗口?