Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • Last Modified:

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.
0
shambhu_421
Asked:
shambhu_421
1 Solution
 
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
 
shambhu_421Author Commented:
Hi sedgwick,
yes,forms are in same document.
thanks,
sham.
0
Technology Partners: 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!

 
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
 
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now