Professional UI Solutions
Site Map   /  Register


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 » MyExtDynamicControlbar is not called virtual method of CExtDynamicControlbar Collapse All
Subject Author Date
Michael chang Feb 13, 2012 - 11:43 PM


I made MyExtDynamicControlbar that derived CExtDynamicControlbar to handle controlbar button.

But, virtual method of CMyExtDynamicControlBar is not called in my application.

what is the problem?



///////My Code is below////////////////////////// 

class CMyExtDynamicControlbar : public CExtDynamicControlBar



           DECLARE_DYNCREATE( CExtCoustomControlbar );


           virtual ~CMyExtDynamicControlbar();

           bool NcButtons_HandleClick(CExtBarNcAreaButton * pNcAreaButton,

                   CPoint point,

                   CExtControlBar * pBarEventSource,

                   CExtControlBar * pBarActiveInContainer);

 void OnNcAreaButtonsReinitialize();



bool CMyExtDynamicControlbar::NcButtons_HandleClick(CExtBarNcAreaButton * pNcAreaButton,

        CPoint point,

        CExtControlBar * pBarEventSource,

        CExtControlBar * pBarActiveInContainer)


           CMainFrame *pWnd = (CMainFrame *)AfxGetMainWnd();

           ASSERT_VALID( this );

          #ifdef _DEBUG

         if( pBarEventSource != NULL )


                 ASSERT_VALID( pNcAreaButton );


          if( pBarEventSource != NULL )


                    ASSERT_VALID( pBarEventSource );


          #endif // _DEBUG





 if (pBarEventSource)


  for (DWORD i = 0; i < 4; i++)


   if (pWnd->m_clsPlaybackTabDlg[i].GetSafeHwnd() == pBarEventSource->m_hWnd)




 return true;


void CMyExtDynamicControlbar::OnNcAreaButtonsReinitialize()


 ASSERT_VALID( this );

 INT nCountOfNcButtons = NcButtons_GetCount();

 if( nCountOfNcButtons > 0 )


 NcButtons_Add( new CExtDynamicBarNcAreaButtonClose(this) );


 NcButtons_Add( new CExtDynamicBarNcAreaButtonAutoHide(this) );

#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)

 NcButtons_Add( new CExtDynamicBarNcAreaButtonMenu(this) );


Technical Support Mar 3, 2012 - 6:20 AM

You forgot to specify runtime class information for your dynamic bar class while invoking the BarAlloc() API. We replied your e-mail.

Technical Support Feb 21, 2012 - 2:24 AM

Could you insert your classes into SDI_DynamicBars sample project and send it to us?

Michael chang Mar 1, 2012 - 8:59 PM

I sent a sample project by E-mail. Please check this issue.


Michael chang Feb 19, 2012 - 5:53 PM

I rebuilded all project but still happens problem. And I need above two methods. specially, I have to catch the event by NcButtons_HandleClick method.

What’s wrong?

Technical Support Feb 15, 2012 - 2:34 AM

Everything looks correct. Adding a new virtual method to the existing class sometimes requires the complete project to be rebuilt so that the added method becomes invoked. Did you try to rebuild the project completely?
The OnNcAreaButtonsReinitialize() virtual method is not needed until you are going to implement custom caption button classes.