CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 23

Threaded View

  1. #14
    Join Date
    Sep 2010
    Posts
    11

    Re: MFC Feature Pack - How to create CMFCPropertySheet control?

    Okay, I tried with the following code:

    Code:
    void CMFCTest4View::OnInitialUpdate()
    {
        CFormView::OnInitialUpdate();
        
        //Create the Properties Sheet
        if(!m_wndPropSheet.Create(this, WS_CHILD | WS_VISIBLE | CBRS_TOP))
        {
            TRACE0("Failed to create toolbar\n");
            //return -1;      // fail to create
        }
    
        GetParentFrame()->RecalcLayout();
        ResizeParentToFit();
    
        //Make Properties Sheet visible
        m_wndPropSheet.MoveWindow(128,128,300,300,true);
    }
    I also tried:

    Code:
        //Make Properties Sheet visible
        RECT rectParent;
        GetParentFrame()->GetWindowRect(&rectParent);
        m_wndPropSheet.MoveWindow(rectParent.left, rectParent.top, rectParent.right-rectParent.left, rectParent.top-rectParent.bottom, true);

    But now I get an "Assertion Failed" right at startup. It is triggered by CWnd::MoveWindow()

    More specifically the following Assertion fails:
    Code:
    void CWnd::MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint)
    {
        ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));
    
        [...]
    }
    Any hint on how to resolve this would be very much appreciated.

    Regards,
    Daniel.
    Last edited by dtrick; September 30th, 2010 at 07:47 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured