BUG: MFC-WinCE Property Page with a Registered ActiveX Control Disappears from the Property Sheet (243457)
The information in this article applies to:
- Microsoft Windows CE Toolkit for Visual C++ 6.0
- The Resource Editor
- The Microsoft Foundation Classes (MFC)
This article was previously published under Q243457 SYMPTOMS
Property page hosting registered CE ActiveX control disappears when the tab for that page is selected. If control is placed on the first page, the property sheet appears for a brief moment, and then disappears. These symptoms are seen on both device and emulator for Windows CE.
CAUSEMicrosoft is researching this problem and will post more information in this article when the information becomes available.RESOLUTION
At this time, there is no resolution to the problem. To work around the problem, the control can be created dynamically at run-time, rather than using the Resource Editor to drag and drop the control on the dialog resource. For example: Override the WM_INITDIALOG for the Property Page Class. The Class Wizard generates the following message map:
// Generated message map functions
//{{AFX_MSG(CMyPropertyPage1)
virtual BOOL OnInitDialog();
//}}AFX_MSG
Then from the menu item, select Project, Add to Project, Components and Control, and then Registered ActiveX Controls. Locate the control you want to add to the property page.
You should assume, that you want to add the Microsoft CE Grid Control 6.0.
Select Microsoft CE Grid Control 6.0 click Insert, OK, and then Close.
Add a protected member variable to the Property Page class of type CGridCtrl using the Class View to add the member variable:
protected:
CGridCtrl m_myGridCtrl;
In the handler for WM_INITDIALOG add the following code to create the control:
BOOL CMyPropertyPage1::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// TODO: Add extra initialization here
m_myGridCtrl.Create(NULL, //LPCTSTR lpszClassName
NULL, //LPCTSTR lpszWindowName
WS_CHILD|WS_VISIBLE, //DWORD dwStyle
CRect(20,20, 200, 200), //const RECT& rect
this, //CWnd* pParentWnd
500, //UINT nID
NULL); //CCreateContext* pContext
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 11/18/2003 |
---|
Keywords: | kbbug kbContainer kbCtrlCreate kbpending kbPropSheet KB243457 kbAudDeveloper |
---|
|