Solved

one formview to another form view..

Posted on 2001-07-04
8
293 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
8 Comments
 
LVL 42

Expert Comment

by:sedgwick
Comment Utility
are the formviews from the same document?

0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
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
Comment Utility
Hi sedgwick,
yes,forms are in same document.
thanks,
sham.
0
 
LVL 42

Expert Comment

by:sedgwick
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Expert Comment

by:bharathd
Comment Utility
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
Comment Utility
hi shambhu_421,
Do you have any additional questions?  Do any comments need clarification?

-- Dan
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 50 total points
Comment Utility
hi shambhu_421,
Do you have any additional questions?  Do any comments need clarification?

-- Dan
0
 
LVL 1

Expert Comment

by:Computer101
Comment Utility
Comment from DanRollins accepted as answer.

Thank you
Computer101
Community Support Moderator
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now