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 General Discussion » Why my MDI application can not update the menu automatically Collapse All
Subject Author Date
George Zhou Mar 16, 2004 - 3:23 PM

What’s the problem of my program:


I have 2 menus: one is IDR_MAINFRAME, the other is IDR_MDITYPE


when I open a file, the menu of the frame does not change, when I move the mouse to the menu, it changes from IDR_MAINFRAME to IDR_MDITYPE.  Could you please tell me how to fix this problem? Thanks in advance!

George Zhou Mar 16, 2004 - 4:32 PM

I found that if I do not dock the menu, it can not be updated automatically.

Technical Support Mar 17, 2004 - 8:04 AM

Dear George,


We tried to produce this bug by running the library’s sample applications unsuccessfully. Please let us know which version of Prof-UIS and Visual Studio (including Service Pack number) do you use? Do you use any third-party components which may hook the standard MDI interface? Of course, we will help you if you let us take a look at your project’s source code.

George Zhou Mar 17, 2004 - 10:45 AM

I am testing your freeware codes downloaded from codeguru.com.


Go to MDI_InnerOuterBars project. In OnCreate(...) of MainFrm.cpp, comment 2 lines:


//m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);


//DockControlBar(&m_wndMenuBar);


then compile and run it. I saw that open a MDI child window or close it, the menu will not be updated automatically.


My OS: Windows 2000 (version 5.0, build 2195: service pack 4)


My Visual Studio.Net: version 7.0.9466 (MS .Net Framework 1.0 version 1.0.3705)


 

Technical Support Mar 18, 2004 - 7:57 AM

Dear George,

Thank you for reporting the bug. To fix it, please find the CExtMenuControlBar::_UpdateMenuBar() method in the ExtMenuControlBar.cpp file and replace these lines:

if( bDoRecalcLayout )
{
_RecalcLayoutImpl();
}

with:

if( bDoRecalcLayout )
{
Invalidate();
_RecalcLayoutImpl();
UpdateWindow();
}


All should work OK after that.

Paula Burkle Apr 7, 2004 - 12:19 PM

hello all,


I had the same problem. I fixed it but there is another bug. if you restore and then maximize the application window, the menu bar is not repainted.


best regards, Paula.