In an sdi application, I have created several additional CFormViews, and switch between them. A view/window could have 50-70 controls plus a lot of static text. The views are created in CMyApp, and also switched there. The switching function ends with:
pActiveView->ShowWindow(SW_HIDE); //last window
pNewView->ShowWindow(SW_SHOWMAXIMIZED); //new window
((CFrameWnd*) m_pMainWnd)->SetActiveView(pNewView);
((CFrameWnd*) m_pMainWnd)->RecalcLayout();
pNewView->Invalidate();
pNewView->SendMessage(WM_APP + 1, 0, 0);
This worked fine until I decided to send that WM_APP message, to massage some of the controls when first displayed. Processing this message in the new CMyFormView seems to be concurrent with window creation. When looping thru the controls, CMyFormView will reach a control that hasn't been created yet. It moves around depending on where the breakpoints are. I've tried SendNotifyMessage, with no change in the result.
Can someone suggest a safe entry method, after all window controls have been created.
The next thing I will try is to simply set a "NewPage" flag on receipt of this msg, then do the processing on the first Setfocus msg received.
pActiveView->ShowWindow(SW_HIDE); //last window
pNewView->ShowWindow(SW_SHOWMAXIMIZED); //new window
((CFrameWnd*) m_pMainWnd)->SetActiveView(pNewView);
((CFrameWnd*) m_pMainWnd)->RecalcLayout();
pNewView->Invalidate();
pNewView->SendMessage(WM_APP + 1, 0, 0);
This worked fine until I decided to send that WM_APP message, to massage some of the controls when first displayed. Processing this message in the new CMyFormView seems to be concurrent with window creation. When looping thru the controls, CMyFormView will reach a control that hasn't been created yet. It moves around depending on where the breakpoints are. I've tried SendNotifyMessage, with no change in the result.
Can someone suggest a safe entry method, after all window controls have been created.
The next thing I will try is to simply set a "NewPage" flag on receipt of this msg, then do the processing on the first Setfocus msg received.