MFC 有关于属性页向导模式对话框点击下一步,对话框自动隐藏的问题

我在MFC中用属性页和属性表建立向导模式对话框时,点击第一个下一步时,对话框可能会会隐藏,就是有时候会有时候不会,

属性表代码 CPropertySheetDlg::CPropertySheetDlg(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
AddPage(&m_FirDlg);
AddPage(&m_SecDlg);
AddPage(&m_ThidDlg);
}

CPropertySheetDlg::CPropertySheetDlg(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
AddPage(&m_FirDlg);
AddPage(&m_SecDlg);
AddPage(&m_ThidDlg);
}

属性页代码如下:
void CPropPageFirDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
CPropertyPage::OnShowWindow(bShow, nStatus);

CRect rect;
GetParent()->GetWindowRect(&rect);
int nWidth =rect.right-rect.left;
int nHeight =rect.bottom-rect.top;
if(bShow)
{
    GetParent()->ShowWindow(SW_HIDE);
    GetParent()->SetWindowPos(NULL,0,0,nWidth,nHeight,SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE);
    GetDlgItem(IDB_BITMAP)->SetWindowPos(NULL,0,0,nWidth,nHeight,SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE);
    GetParent()->ShowWindow(SW_SHOW);
}

}

BOOL CPropPageFirDlg::OnSetActive()
{
((CPropertySheet*)GetParent())->SetWizardButtons(PSWIZB_NEXT);

return CPropertyPage::OnSetActive();

}

都只是一部分