From: Guido Franzke on 30 Jun 2010 11:32 Hello NG, I have an MDI app. The view has a property page. There I have OnSetActive that calls a function "FillEditCtrl" to showsvalues in an edit control. I call a menu that opens a dialog. The user can edit values that are shown in the edit control of the property page of the view. The user closes the dialog. But OnSetActive of my property page is not called, so the values are not shown in my view. After closing the dialog, what afx msg is called instead? void CMainFrame::OnMenuEditValues() { CWnd* pw = GetActiveWindow(); CTheDialog dlg; dlg.DoModal(); pw->SetActiveWindow(); } I don't call the FillEditCtrl directly from CMainFrame, because the user can open other docview-Windows (MDI) How does the property page know, that it is active again after the dialog to call FillEditCtrl? Thanks for help, Guido
From: David Lowndes on 30 Jun 2010 12:47 >I have an MDI app. The view has a property page. There I have OnSetActive >that calls a function "FillEditCtrl" to showsvalues in an edit control. That seems a mighty odd event to populate an edit control from! >I call a menu that opens a dialog. The user can edit values that are shown >in the edit control of the property page of the view. >The user closes the dialog. But OnSetActive of my property page is not >called, so the values are not shown in my view. The correct way of getting things to update is to call UpdateAllViews from your CDocument derived class. Go with the flow of the MFC Doc/View - life will be simpler. If you've not already done so, I recommend that you go through the MFC scribble sample - that illustrates the fundamentals of using MFC Doc/View. Dave
|
Pages: 1 Prev: Different Problems - Same Solution Next: Simple hack to get $500 to your home. |