i've run out of ideas.. i'm working with a Tab Control and on some systems the program crashes when accessing a global HWND for the two dialogs i use here. on my system it's all ok.
anyone know whats wrong here?
it works fine when i pass hwndDlg (from the parent window) to ShowWindow() which doesnt make sense of course but helped to localize the error. however, phDlg or phDlg as argument causes the app to crash - on some systems.Code:HWND phDlg; // ... // in the dialog procedure i catch WM_INITDIALOG and initialize phDlg. // hwndDlg is the handle of the dialog the tab is placed on: phDlg = CreateDialog(hInst, MAKEINTRESOURCE(IDD_TABDIALOG1), hwndDlg, (DLGPROC)TabDlg1Proc); phDlg = CreateDialog(hInst, MAKEINTRESOURCE(IDD_TABDIALOG2), hwndDlg, (DLGPROC)TabDlg2Proc); // then i catch TCN_SELCHANGING and TCN_SELCHANGE and show the appropriate dialog: int nCurSel = TabCtrl_GetCurSel(hwndDlg); if ((nCurSel >= 0) && (nCurSel <= 1)) ShowWindow(phDlg[nCurSel], SW_SHOW);