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 » Control Performance Problem w/CExtControlBar::DoCustomModeUpdateControlBars() Collapse All
Subject Author Date
Michael Bailey Aug 25, 2006 - 5:08 PM

Hi,

Prof-UI is a great library and all of the controls I’ve added to my application have exceeded my expectations - nice job. There is one problem that I’m having that is concerning me; it’s the performance of the controls on a large application such as mine. My application has a lot of modeless (dock-able) dialogs with a lot of controls (buttons, check boxes, edit boxes, etc.) in each. I’ve started to do some profiling to try and find the bottlenecks in the Prof-UI code. Some of these performance problems can be seen in the Prof-UI TabbedBars sample application with all the color swatches.

I have discovered that when I call CWnd::EnableWindow() to enable/disable dialog controls (such as a CExtButton), there’s a lot of code that gets called behind the scenes and seems to slow things down. What should be a simple repaint of the control being enabled/disabled turns into much more.

Calling CWnd::EnableWindow() ends up calling CExtControlBar::DoCustomModeUpdateControlBars(), and DoCustomModeUpdateControlBars() steps through all the controls in the control bar. This can cause a major slowdown if the dialog has a lot of controls and EnableWindow() is called for many of them. I have run several other profile tests and they all point to CExtControlBar::DoCustomModeUpdateControlBars() being a large bottleneck.

Is there a reason all these extra functions are called for a simple enable/disable? Any way I can avoid this?

Thanks for any help,
Mike

Here is a sample call stack:

>    DeepCreator.exe!CExtControlBar::DoCustomModeUpdateControlBars(CWnd * pWndParentTarget=0x03e38ed8, int bDisableIfNoHndler=1) Line 6392    C++
    DeepCreator.exe!CExtResizableDialog::WindowProc(unsigned int message=25, unsigned int wParam=0, long lParam=42111460) Line 149 + 0xb    C++
    DeepCreator.exe!CWnd::OnNTCtlColor(unsigned int wParam=738269446, long lParam=527368) Line 1474    C++
    DeepCreator.exe!CWnd::OnWndMsg(unsigned int message=309, unsigned int wParam=738269446, long lParam=527368, long * pResult=0x02829310) Line 2013 + 0x11    C++
    DeepCreator.exe!CWnd::WindowProc(unsigned int message=309, unsigned int wParam=738269446, long lParam=527368) Line 1745 + 0x1e    C++
    DeepCreator.exe!CExtWS<CExtADLG<CExtResDlg>,301>::WindowProc(unsigned int message=309, unsigned int wParam=738269446, long lParam=527368) Line 919 + 0x14    C++
    DeepCreator.exe!CExtWA<CExtWS<CExtADLG<CExtResDlg>,301> >::WindowProc(unsigned int message=309, unsigned int wParam=738269446, long lParam=527368) Line 1657 + 0x14    C++
    DeepCreator.exe!CExtResizableDialog::WindowProc(unsigned int message=309, unsigned int wParam=738269446, long lParam=527368) Line 137 + 0x14    C++
    DeepCreator.exe!AfxCallWndProc(CWnd * pWnd=0x03e38ed8, HWND__ * hWnd=0x00080b56, unsigned int nMsg=309, unsigned int wParam=738269446, long lParam=527368) Line 241 + 0x1a    C++
    DeepCreator.exe!AfxWndProc(HWND__ * hWnd=0x00080b56, unsigned int nMsg=309, unsigned int wParam=738269446, long lParam=527368) Line 389    C++
    user32.dll!77d48734()     
    user32.dll!77d48816()     
    user32.dll!77d4b89b()     
    user32.dll!77d4b903()     
    comctl32.dll!773f6c9c()     
    user32.dll!77d4b6c8()     
    comctl32.dll!773f887b()     
    user32.dll!77d488d1()     
    user32.dll!77d4c487()     
    comctl32.dll!773f8dc7()     
    user32.dll!77d48734()     
    user32.dll!77d48816()     
    user32.dll!77d4c63f()     
    user32.dll!77d4e905()     
    DeepCreator.exe!CWnd::DefWindowProcA(unsigned int nMsg=15, unsigned int wParam=0, long lParam=0) Line 1024 + 0x20    C++
    DeepCreator.exe!CExtButton::DefWindowProcA(unsigned int message=15, unsigned int wParam=0, long lParam=0) Line 884 + 0x14    C++
    DeepCreator.exe!CWnd::Default() Line 275    C++
    DeepCreator.exe!CWnd::OnPaint() Line 4111    C++
    DeepCreator.exe!CExtButton::OnPaint() Line 1702    C++
    DeepCreator.exe!CWnd::OnWndMsg(unsigned int message=15, unsigned int wParam=0, long lParam=0, long * pResult=0x0282a224) Line 2023    C++
    DeepCreator.exe!CWnd::WindowProc(unsigned int message=15, unsigned int wParam=0, long lParam=0) Line 1745 + 0x1e    C++
    DeepCreator.exe!CExtButton::WindowProc(unsigned int message=15, unsigned int wParam=0, long lParam=0) Line 2255 + 0x14    C++
    DeepCreator.exe!AfxCallWndProc(CWnd * pWnd=0x03e42398, HWND__ * hWnd=0x00080c08, unsigned int nMsg=15, unsigned int wParam=0, long lParam=0) Line 241 + 0x1a    C++
    DeepCreator.exe!AfxWndProc(HWND__ * hWnd=0x00080c08, unsigned int nMsg=15, unsigned int wParam=0, long lParam=0) Line 389    C++
    user32.dll!77d48734()     
    user32.dll!77d48816()     
    user32.dll!77d4b4c0()     
    user32.dll!77d4b50c()     
    ntdll.dll!7c90eae3()     
    user32.dll!77d4d83f()     
    user32.dll!77d4d82a()     
    DeepCreator.exe!CWnd::UpdateWindow() Line 127 + 0x36    C++
    DeepCreator.exe!CExtButton::OnCancelMode() Line 678    C++
    DeepCreator.exe!CWnd::OnWndMsg(unsigned int message=31, unsigned int wParam=0, long lParam=0, long * pResult=0x0282a738) Line 2023    C++
    DeepCreator.exe!CWnd::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 1745 + 0x1e    C++
    DeepCreator.exe!CExtButton::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 2255 + 0x14    C++
    DeepCreator.exe!AfxCallWndProc(CWnd * pWnd=0x03e42398, HWND__ * hWnd=0x00080c08, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 241 + 0x1a    C++
    DeepCreator.exe!AfxWndProc(HWND__ * hWnd=0x00080c08, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 389    C++
    user32.dll!77d48734()     
    user32.dll!77d48816()     
    user32.dll!77d4b4c0()     
    user32.dll!77d484fc()     
    user32.dll!77d4b50c()     
    ntdll.dll!7c90eae3()     
    user32.dll!77d4be69()     
    user32.dll!77d4be83()     
    DeepCreator.exe!CWnd::EnableWindow(int bEnable=0) Line 353 + 0x11    C++

Technical Support Aug 31, 2006 - 9:44 AM

We are sorry for the delay with this reply. Please take a look at the CExtResizableDialog::WindowProc() method’s source code. The command updating mechanism is invoked with idle messages only and the CWinApp::IsIdleMessage() method is used to detect whether the message is idle. We invalidate nothing. So, you can override the CWinApp::IsIdleMessage() virtual method in your CWinApp-derived application class and analyze whether all or particular WM_ENABLE messages are not idle.