void DlgClassName::OnFun()
{
  if (m_pPCSheet->GetSafeHwnd() == 0) {
    m_pPCSheet->Create(this);
  }
  else m_pPCSheet->BringWindowToTop();
}
的时候窗口不出现,debug框出现PropertySheet() failed: GetLastError returned 0
请问什么原因?我DoModal()也出现同样的问题

解决方案 »

  1.   

    问题已经解决,现换一个问题,为什么我用无模式的sheet,下面那几个Apply, cancel, ok..就没有出现了?但是用DoModal就出来了。如果我想更换那几个button的名字,或者增加其他的button如何做,谢谢
      

  2.   

    自己顶,大家帮忙啊,怎么csdn人少了
      

  3.   

    Modeless property sheets displayed with a call to Create do not have OK, Cancel, Apply Now, and Help buttons as modal property sheets do. Desired buttons must be created by the user
      

  4.   

    What I want to know is how to "created by the user" for the modeless property sheets.
      

  5.   

    your question is 
    void DlgClassName::OnFun()
    {
      if (m_pPCSheet->GetSafeHwnd() == 0) {
        m_pPCSheet->Create(this);
      }
      else m_pPCSheet->BringWindowToTop();
    }
    的时候窗口不出现,debug框出现PropertySheet() failed: GetLastError returned 0
    请问什么原因?我DoModal()也出现同样的问题
      

  6.   

    实现CPropertySheet的子类
    重载 OnInitdialog
    在里面 先改变窗口大小,再一个个的Create Button和其他控件
    (确定等按钮只是不显示,你可以把他们显示出来
    hwnd = GetDlgItem(m_hWnd, IDOk);
    ::ShowWindow(hwnd, SW_NORMAL)
    Hotthing(豪星):
    void DlgClassName::OnFun()
    {
      if (m_pPCSheet->GetSafeHwnd() == 0) {
        m_pPCSheet->Create(this);
      }
      else m_pPCSheet->BringWindowToTop();
    }
    的时候窗口不出现,debug框出现PropertySheet() failed: GetLastError returned 0
    请问什么原因?我DoModal()也出现同样的问题应该是函数内变量和类变量的问题, 把page声明到类里面去
      

  7.   

    在里面 先改变窗口大小,再一个个的Create Button和其他控件
    (确定等按钮只是不显示,你可以把他们显示出来
    hwnd = GetDlgItem(m_hWnd, IDOk);
    ::ShowWindow(hwnd, SW_NORMAL)
    具体如何改变大小,不显示的又有哪些buttons,如何创建自己的button,并且添加响应函数呢
      

  8.   

    就是OK, cancel, help这几个你想要得。
    CButton Bt;Bt.Create(_T("OK"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 
       CRect(10,10,100,30), pParentWnd, IDC_BUTTON1)添加消息
    //.h
    // Generated message map functions
    //{{AFX_MSG(DlgClassName)
    afx_msg void OnButton1();
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()//.cpp
    BEGIN_MESSAGE_MAP(DlgClassName, CDialog)
    //{{AFX_MSG_MAP(DlgClassName)
    ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
    //}}AFX_MSG_MAP
    END_MESSAGE_MAP()DlgClassName::OnButton1()
    {
    }