Not access to child dialog object... Assert Error..
-
Not able to access child dialog object, Assert Error.. //Pointers to dialogs CDialog * pCMyApp; CDialog * pCChildDialogs[5]; //array of dialogs . . . void CMyApp::function() { //trying to SetWindowText to one of the child dialogs objects. pCChildDialog[0]->GetDialogItem(IDC_STATIC1)->SetWindowText(mystring); //MVS2005 intelliSense shows this path ok } Other functions "PCChildDialog[N]->???" seem to work fine within this CMyApp function. But in this situation I get an Assert Error.. and it drops me off here void CWnd::SetWindowsText(LPCTSTR lpszString) { ...... ENSURE(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL)); <------------
-
Not able to access child dialog object, Assert Error.. //Pointers to dialogs CDialog * pCMyApp; CDialog * pCChildDialogs[5]; //array of dialogs . . . void CMyApp::function() { //trying to SetWindowText to one of the child dialogs objects. pCChildDialog[0]->GetDialogItem(IDC_STATIC1)->SetWindowText(mystring); //MVS2005 intelliSense shows this path ok } Other functions "PCChildDialog[N]->???" seem to work fine within this CMyApp function. But in this situation I get an Assert Error.. and it drops me off here void CWnd::SetWindowsText(LPCTSTR lpszString) { ...... ENSURE(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL)); <------------
Hehe, go figure.. get stumped on something for hours and figure it out only seconds after writing a post.. pCChildDialog[0]->SetDlgItemTextW(IDC_STATIC1, mystring); //This fixed it :)