Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Question about TabbedView sample
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Question about TabbedView sample

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


Joined: 09 December 2006
Status: Offline
Points: 42
Post Options Post Options   Thanks (0) Thanks(0)   Quote zjroland Quote  Post ReplyReply Direct Link To This Post Topic: Question about TabbedView sample
    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?
Oleg, pleae test here: main menu - Edit - Test
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
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.219 seconds.