Why second line of code below rises exception

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

and code below goes without problems

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

?

有帮助吗?

解决方案

Because the first dosen't create the dialog's underlying window?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top