Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - IsValid, IsClosed, Handle
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

IsValid, IsClosed, Handle

 Post Reply Post Reply
Author
Message
Stratiotes View Drop Down
Newbie
Newbie
Avatar

Joined: 21 March 2006
Location: United States
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Stratiotes Quote  Post ReplyReply Direct Link To This Post Topic: IsValid, IsClosed, Handle
    Posted: 21 March 2006 at 3:55pm

I have a question about the suggested method to use in this case.

I had the following code to capture the current pane rectangle:

 CXTPDockingPane * pPane = m_paneManager.FindPane(IDR_MY_PANE);
 if( pPane != NULL && pPane->IsValid() )
 {
    CRect rectPane( pPane->GetPaneWindowRect() );

    // do something with rectPane
}

Now a problem came when the user clicked on the "x" to close the pane and then it came to this code - it throws an exception on the GetPaneWindowRect.   Which led me to wonder why it was not NULL and still valid even after being closed - is that intentional?

Second question, I thought it would be easy to fix by adding a pPane->GetSafeHwnd(); to the if-test but then the build failrue indicates that GetSafeHwnd is a protected member and cannot be called here.  So I looked thru the header file and found the  IsClosed() method and add a !pPane->IsClosed() to the test and that resolves the issue.   Is that the preferred method for handling this situation?

Thanks

 

Mark
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.186 seconds.