Click to See Complete Forum and Search --> : How can I control Child Window in MDI
Drago
April 10th, 1999, 05:57 AM
Hi,
I need your help.
How can I control every Child Window in MDI.
I'd like to apply any different constant(number) to every Child Window.
How can I do that.
Please help me !!!!!
Thanke you in advance.
Drago
Dave Lorde
April 12th, 1999, 06:15 AM
What do you mean by
> I'd like to apply any different constant(number) to every Child Window.
Dave
Drago
April 12th, 1999, 04:07 PM
Hi,
Thank you for interest to my question.
I mean that I can't recognize every child window.
I suppose that I must apply any mark to make recognize every child window.
Just for example: Opening a new File and add to it differents parameters
which are special for this document and after that control all views by this parameters. And then use GetFirsDocTemplatePosition() and GetNextDocTemplate() to control all views.
Waiting you reply.
Thank you.
Drago
Dave Lorde
April 13th, 1999, 04:11 AM
I'm still not sure what you're trying to do, but if you want to be able to identify views according to the document type they are attached to, access them via the document itself with GetFirstViewPosition/GetNextView.
If you want to identify individual view instances by some criterion, you'll need to give them a method you can use to query their identity, based on that criterion.
If you want to identify views by their class type, use run-time type identification, or the new-style dynamic cast.
Dave
Drago
April 13th, 1999, 02:36 PM
I'd like to thank you for this answer. You describe my problem exactly(to identify individual view instances by some criterion). Now I understood what must I do, but if it's posible please give me more information about this.
Thank you once again.
Drago
victoriach
October 13th, 1999, 03:19 AM
Hi! I have the same problem. If you know how to solve it replay me please.
Thanks
Drago
October 16th, 1999, 02:45 AM
Hi Victoria,
I remembered that my problem was that I could not got a pointer of each MDI Child Window and use it for access to MDI Child's.
Here what I had done:
For storing each pointer to MDI Child I use CObList object. And when I open a new Document I put a pointer of this document using AddHead(this). And when I close a document I remove it's poiter from this CObList using:
POSITION posDoc = pList->Find(this);
pList->RemoveAt(posDoc);
Where pList is declare in CMyFrame.h like that:
CObList* pList;
For each MDI Child Window you have a Document. And when you have a poiter to this Document you are able to control a View's of MDI Child Windows with:
POSITION pos = pDoc->GetFirstViewPosition();
while (pos != NULL)
{
CView pView = pDoc->GetNexView(pos)
}
This pDoc is pointer to your CDocument derived class. You store it into CObList. And you have a pointer to your class derived from CDocument for each open MDI Child Window.
I hope that help you.
Please let me know if this work or not.
drago@gb.bia-bg.com
Regards: Drago
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.