A SERVICE OF

logo

BOOL shrinkToClient = FALSE,
TModule* module = 0);
where:
parent is the child window’ parent. In this case, the TMyApps
member Client will always be the parent.
title is the window title. Y u don’t need to specify anything in thiso
case, because it’ filled in automaticallys .
clientWnd specifies the client window for the MDI child. Y u shouldo
pass a pointer to the view’ window.s
shrinkT Client specifies whether the MDI child should shrink to fito
its client window. This parameter isn’t used in this example.
module isn’t used in this example.
Once you’ e created the TMDIChild object, you need to set its menuv
descriptor but only if the view has a menu descriptor itself. After,
setting the menu descriptor call the MDI child’ Create function., s
The EvNewView function should now look something like this:
void
TMyApp::EvNewView(TView& view)
{
TMDIChild* child = new TMDIChild(*Client, 0, view.GetWindow());
if (view.GetViewMenu())
child->SetMenuDescr(*view.GetViewMenu());
child->Create();
}
In the SDI version of the tutorial application, you had to check to
Modifying drag and
make sure the user didn’t drop more than one file into the application
drop
area. But in MDI, if the user drops in more than one file, you can open
them all, with each document in a separate window. Here’ how tos
implement the ability to open multiple files dropped into your
application:
Find the number of files dropped into the application. Use the
DragQueryFileCount function. Use a for loop to iterate through the
files.
For each file, get the length of its path and allocate a char array
with enough room. Call the DragQueryFile function with the file’s
index (which you can track using the loop counter), the char array,
and the length of the path.
Chapter 2, Learning ObjectWindows
97