Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Can I Use a CView class in the function AttachView
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Can I Use a CView class in the function AttachView

 Post Reply Post Reply
Author
Message
fireflame View Drop Down
Groupie
Groupie


Joined: 15 March 2007
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote fireflame Quote  Post ReplyReply Direct Link To This Post Topic: Can I Use a CView class in the function AttachView
    Posted: 29 July 2008 at 4:28am
The code is following:
LRESULT CEventBrowserView::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)
{
 if (wParam == XTP_DPN_SHOWWINDOW)
 {
  CXTPDockingPane* pPane = (CXTPDockingPane*)lParam;
  if((!pPane->IsValid()) && (pPane->GetID() == ID_DOCK))
  {
   if(!m_pOptionView)
    m_pOptionView = DYNAMIC_DOWNCAST(CEventBrowserOptionView,
     pPane->AttachView(this, RUNTIME_CLASS(CEventBrowserOptionView)));
   if(m_pOptionView->GetSafeHwnd())
   {
    pPane->SetTitle(_T("事件列表查询选项"));
    pPane->SetMaxTrackSize(CSize(0,60));
   }
  }
 }
 return TRUE;
}
 
the CEventBrowserOptionView is inherited from CView,while i run it in degbug mode everything is ok,but while i'm using release mode,there'll be an error happened when i close the CEventBrowserView.
 
Is there any special requirements for the CEventBrowserOptionView?
HELP!!!! please
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 29 July 2008 at 9:20am
Hi;

Have you tried to overload CView::PostNcDestroy(). The default implementation calls  delete this;
Perhaps the view object will be deleted twice, because panes are derived from CCmdTarget and InternalRelease() will be called -> CCmdTarget::OnFinalRelease() also calls delete this!

Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
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.148 seconds.