Activate a specific View in an MDI MFC Doc/View App
-
I have a VC++ 6 MDI application using the conventional MFC Doc/View architecture. At any given time there can be several different views of several different document types open. I want to be able to programmatically "activate" one of these Views, i.e. if it is hidden by other Views then I want it to become visible, just as if the User clicked on the relevent numbered item in the Windows menu (NB this does work correctly). The specific View that is to be activated does not directly depend on User input, e.g. it could be as a result of a message from another thread. This seems to be an obvious thing to be able to do yet I cannot make it work. I am inside a message handler within my CMainFrame class; I have a CMyView* to the View I want to activate.
MDIActivate(pMyView)
seems to do nothing; I can't getCMDIChildWnd::MDIActivate()
to work for me. Perhaps it is something to do with me using the above functions with a CView* not a CWnd*. Can I deduce the latter from the former in a way that will make this work? What else may be wrong? All assistance appreciated.