Print Page | Close Window

SetActiveView

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=15234
Printed Date: 22 November 2024 at 5:47pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SetActiveView
Posted By: gmail
Subject: SetActiveView
Date Posted: 23 September 2009 at 3:57pm
I'm using your CXTPMDIFrameWnd derived CMainFrame class with multiple views in my application. If I open 4 different views and I wan't to set e.g. second view active I can't. Here's the snippet:

POSITION pos=NULL;
pos=pApp->pIzvTemplate->GetFirstDocPosition();
pDoc=pApp->pIzvTemplate->GetNextDoc(pos);
pos=pDoc->GetFirstViewPosition();                       
CView *pView=pDoc->GetNextView(pos);
if(pView){
       ((CMainFrame*)AfxGetMainWnd())->SetActiveView(pView,TRUE);
}

Not only it doesn't changes the active view, after exit it crashes (but that's irrelevant for this situation, I'll try to fix it later). And if I call GetActiveView() after SetActiveView() it returns the correct one - but it's not shown. I'm using XTP 12.1. So, how can we switch between views?



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