Putting MDI Children In A Dynamically Linked Library

By: Kevin Scardina

Abstract: This document discribes how and why to put MDI Children in a Package.

Question: I am creating an MDI application and I would like to put my child window inside of a dll. How would I accomplish this?

Answer: Many times in an MDI applications the developer would like to place the children inside of a dynamically linked library. A problem arises when trying to do this with a Borland VCL DLL. The problem is that a VCL DLL has a TApplication class that is different then the TApplication class of the calling application. When this occurs the MDI Child checks its TApplication class for the Parent window and none is found. Of course none is found because the TApplication class that has the parent is in the calling application not the DLL. So to get around this it is recommended that one uses a Package instead of a DLL. To do this simply create a package instead of a DLL and then add your MDI Child to the package. Treat the package just like you treat a DLL.

For a more in-depth example of doing this take a look at code example 14512.


Server Response from: ETNASC02