Article ID: 246044
Article Last Modified on 8/15/2005
APPLIES TO
- Microsoft Visual Studio 6.0 Enterprise Edition
- Microsoft Visual Studio 97 Service Pack 3
This article was previously published under Q246044
SYMPTOMS
Unable to change tabs in a Microsoft Tabbed Dialog Control if the control is added dynamically.
CAUSE
The control does not know that it is loaded.
RESOLUTION
Add the following code after the creation of the control:
// Assume pMSTabCtl is a pointer to an instance of a CSSTabCtl object LPUNKNOWN pUnk = pMSTabCtl->GetControlUnknown(); LPOLECONTROL pCtl; pUnk->QueryInterface(&pCtl); pCtl->FreezeEvents(TRUE); pCtl->FreezeEvents(FALSE); pCtl->Release();
MORE INFORMATION
Steps to Reproduce Behavior
Add the Microsoft Tabbed Dialog Control to an MFC application using the Component Gallery. This adds the CSSTabCtl, COleFont, and CPicture classes to the application.Declare a variable that is a pointer to a CSSTabCtl, for example, pMSTabCtl.Dynamically add the control to a window. See the following code for an example of this:
pMSTabCtl = new CSSTabCtl; ASSERT( pMSTabCtl ); VERIFY( pMSTabCtl->Create( NULL, <BR/> WS_VISIBLE | WS_CHILD | WS_MAXIMIZEBOX, CRect( 10, 10, 300, 200 ), this, ID_XXXXX, NULL, FALSE, NULL ) );
Run the application and try selecting different tabs.
Additional query words: SSTAB tab OCX ActiveX
Keywords: kbcontainer kbprb kbctrl KB246044