Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

one formview to another form view..

Posted on 2001-07-04
8
Medium Priority
?
302 Views
Last Modified: 2013-11-20
Hi friends,
In my application , i need to call one formview from another formview.
could you kindly help me.
thnaks!
sham.
0
Comment
Question by:shambhu_421
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 6253037
are the formviews from the same document?

0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6253807
If you want the second view to pop up and float over the first view, then your best bet is to use a modal dialogbox for the scond view.

If you want the second view to replace the first view, you need to use code that will replace the current view.  This is a very common need, even if it is a bit tricky.  It is decribed in:

Q149257 - How to Replace a View in a Splitter Window
http://support.microsoft.com/support/kb/articles/Q149/2/57.ASP

and

Q102829 - How to Replace a View in a CMDIChildWnd Window
http://support.microsoft.com/support/kb/articles/Q102/8/29.asp 

-- Dan
0
 

Author Comment

by:shambhu_421
ID: 6254428
Hi sedgwick,
yes,forms are in same document.
thanks,
sham.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 42

Expert Comment

by:sedgwick
ID: 6254658
so iterate your document using POSITION:

//u r in the scope of one of the forms view:
CMyDocument()* pDoc = GetDocument();
POSITION pos = pDoc->GetFirstViewPosition();
while(pos)
{
CMyFormView* pView = (CMyFormView*)pDoc->GetNextView(pos);
if(pView == this)
    continue; //the same form view

/*since u can have more than 2 viewes in the document so u probably have an identification in order to determine which form view u want to work with.*/

}

good luck
0
 

Expert Comment

by:bharathd
ID: 6255302
U can use the IsKindof() function to determine what view you are iterating through. This function violates polymorphism but is handy at times like this.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6309914
hi shambhu_421,
Do you have any additional questions?  Do any comments need clarification?

-- Dan
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 200 total points
ID: 6352566
hi shambhu_421,
Do you have any additional questions?  Do any comments need clarification?

-- Dan
0
 
LVL 1

Expert Comment

by:Computer101
ID: 6703238
Comment from DanRollins accepted as answer.

Thank you
Computer101
Community Support Moderator
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question