Question

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)

?

Était-ce utile?

La solution

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top