Can I Use a CView class in the function AttachView |
Post Reply |
Author | |
fireflame
Groupie Joined: 15 March 2007 Status: Offline Points: 21 |
Post Options
Thanks(0)
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
|
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |