Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtTabMdiWnd doesn't update properly when close button is pressed Collapse All
Subject Author Date
Lynn Reid Apr 25, 2007 - 7:57 PM

I’ve got an MDI Doc/View application which can open multiple documents, each in their own tabbed window. There are four views in each tab, created with a splitter. There’s also a bunch of other stuff going on with three dockable control bars which display additional views of the topmost document.

My problem:
When I click on the "x" close button, either in the ChildFrame or in the main menu bar, the topmost tab disappears and the document is closed. The next document’s tab becomes uppermost, but the views don’t refresh. I get a completely blank white screen -- the frames and splitters are all properly arranged, but nothing displays within them.

If I activate another tab by clicking on it, it displays properly. Same thing if I go back to the original "blank" tab. But nothing refreshes properly when the close button is pressed.

This USED to work before I implemented my tabs as CExtTabMdiWnd... so I suspect I need to call something in addition to the defaults. Within the ChildFrame, I’ve tried to UpdateAllViews(NULL) ala

void CMIPSChildFrame::OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd)
{
    CMDIChildWnd::OnMDIActivate(bActivate, pActivateWnd, pDeactivateWnd);

    CMainFrame* pMF = (CMainFrame*) ::AfxGetMainWnd();
    if (bActivate) {        // window is becoming active
        CView5Doc* pDoc = (CView5Doc*) GetActiveDocument();
        if (pDoc) {
            // load history window with current document
            CHistoryBar* pBarHistory = (CHistoryBar*) pMF->GetControlBar(ID_VIEW_HISTORY);
            if (pBarHistory != NULL) pBarHistory->SetHistory(pDoc);
            // maybe update the view? Doesn’t work, still blank white....
            pDoc->UpdateAllViews(NULL);
        }
....

Any suggestions? I’m going to have to disable all the X buttons if I can’t get this to work....

Thanks, Lynn

Technical Support Apr 26, 2007 - 1:42 PM

We are not sure that the problem is brought by Prof-UIS. The DRAWCLI sample seems to be very close to your project. It have MDI tabs and splitter based views but we failed to reproduce the problem in it. Please try the following:

1) Exclude some parts of the code from your application step-by-step so you can figure out when the problem is gone.
2) Modify the DRAWCLI sample so you can reproduce the problem and send it to us.