Print Page | Close Window

Question about TabbedView sample

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6123
Printed Date: 25 September 2024 at 9:11am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Question about TabbedView sample
Posted By: zjroland
Subject: Question about TabbedView sample
Date Posted: 15 January 2007 at 9:20am
I need to run a function of CPropertiesView at CTabbedViewView, but error occurs.
There is a function in CPropertiesView, I need to use it at  CTabbedViewView.
here is my code:
 
void CTabbedViewView::OnEditTest()
{
 CView* pView = DYNAMIC_DOWNCAST(CView, CWnd::FromHandle(m_wndTabControl.GetSelectedItem()->GetHandle()));  //here error occurs
 ((CPropertiesView*)pView)->Doatest();
}
 
but error occurs, I debug to XTPTabManager.h
AFX_INLINE CXTPTabManagerItem* CXTPTabManager::GetSelectedItem() {
 return m_pSelected;    //here error occurs
}
 
How can I run this function at CTabbedViewView?
here is my code. https://forum.codejock.com/uploads/20070115_091807_TabbedView.zip - uploads/20070115_091807_TabbedView.zip
Oleg, pleae test here: main menu - Edit - Test



Replies:
Posted By: Oleg
Date Posted: 15 January 2007 at 9:41am
Problem in
void CMainFrame::OnEditTest()
{
 CTabbedViewView *m_pView  = (CTabbedViewView *)this->GetActiveView();
 m_pView->OnEditTest();
}
 
GetActiveView is not CTabbedViewView .
 
better add
ON_COMMAND(ID_EDIT_TEST, OnEditTest)
in CPropertiesView. and remove CMainFrame::OnEditTest() and TabbedViewView::OnEditTest()


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net