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)

?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top