one formview to another form view..

Hi friends,
In my application , i need to call one formview from another formview.
could you kindly help me.
thnaks!
sham.
shambhu_421Asked:
Who is Participating?
 
DanRollinsConnect With a Mentor Commented:
hi shambhu_421,
Do you have any additional questions?  Do any comments need clarification?

-- Dan
0
 
Meir RivkinFull stack Software EngineerCommented:
are the formviews from the same document?

0
 
DanRollinsCommented:
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
shambhu_421Author Commented:
Hi sedgwick,
yes,forms are in same document.
thanks,
sham.
0
 
Meir RivkinFull stack Software EngineerCommented:
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
 
bharathdCommented:
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
 
DanRollinsCommented:
hi shambhu_421,
Do you have any additional questions?  Do any comments need clarification?

-- Dan
0
 
Computer101Commented:
Comment from DanRollins accepted as answer.

Thank you
Computer101
Community Support Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.