I have a problem Destroy/Re-create CPropertySheet with ActiveX in one of the CPropertySheet in a CFormView.
I succeed adding CPropertySheet to a CFormView (using codeguru example: http://www.codeguru.com/propertysheet/inside_formview.shtml
). I can Destroy/Re-Create this CPropertySheet dynamically in the CFormView with no problem. I Destroy the CPropertySheet and re-create it in order to change its style from Tab to Wizard. this action work fine only if there aren't any MS FlexGrid (ActiveX control) in one of the CPropertyPage I add to the CPropertSheet. when one of the CPropertyPage include MS FlexGrid control the application hang (take a full 100% CPU). this problem occurs only after destroy and re-create the CPropertySheet (and not in the first creation of CPropertySheet).
I read one of the comments to the codeguru article (http://www.codeguru.com/mfc/comments/26344.shtml
), that suggests I need to perform the following steps:
Step 1 - Override OnInitDialog() for the child CPropertySheet, and add the WS_EX_CONTROLPARENT style.
BOOL bResult = CPropertySheet::OnInitDial
ModifyStyleEx( 0, WS_EX_CONTROLPARENT );
Step 2 - you need to modify extended style of your ActiveX control. It should look like this:
eWindow( CREATESTRUCT& cs )
cs.lpszClass = _T("STATIC");
cs.dwExStyle |= WS_EX_CONTROLPARENT;
Some thing similar is mention in Microsoft's resources: http://support.microsoft.com/default.aspx?scid=kb;EN-US;q149501
I tried what Microsoft article said but it doesn't help. I also tried to perform what the above codeguru comment suggest, but couldn't find a way to modify extended style of MS FlexGrid (see my question on Experts Exchange: http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=mfc&qid=20277330
thanks for any advise, suggestion.