Get Window Handle to Modless Dialog Box After Create
-
Hi I have a modeless dialog box in Which I create a Rich Edit After the Create I try to acess the Window Handle via GetSafeHwnd Sometimes I get an exception
HWND dlgwnd; main\_app->progdbg->Create(IDD\_PROGDBG,AfxGetMainWnd()); dlgwnd = main\_app->progdbg->GetSafeHwnd();
-
Hi I have a modeless dialog box in Which I create a Rich Edit After the Create I try to acess the Window Handle via GetSafeHwnd Sometimes I get an exception
HWND dlgwnd; main\_app->progdbg->Create(IDD\_PROGDBG,AfxGetMainWnd()); dlgwnd = main\_app->progdbg->GetSafeHwnd();
-
Hi I have a modeless dialog box in Which I create a Rich Edit After the Create I try to acess the Window Handle via GetSafeHwnd Sometimes I get an exception
HWND dlgwnd; main\_app->progdbg->Create(IDD\_PROGDBG,AfxGetMainWnd()); dlgwnd = main\_app->progdbg->GetSafeHwnd();
ForNow wrote:
Sometimes I get an exception
And exactly this exception look like? And did you try to debug your code to be sure all the parts of your expressions are correct?
-
Well,
Create
method might fail. You are not checking its return value (it is worth noting thatCreate
, on success, returns the handle you are searching for).