> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] > Sent: Wednesday, 29 March 2006 10:23 p.m. > To: Borland's Delphi Discussion List > Subject: Re: Modular Program > > > ----- Original Message ----- > From: "Sean Cross - CRM" <[EMAIL PROTECTED]> > To: "Borland's Delphi Discussion List" <[email protected]> > Sent: Tuesday, March 28, 2006 11:04 PM > Subject: RE: Modular Program > > > > IMHO packages are a better solution as you can pass objects between > modules. Doing this with dll's is rather difficult, > > but you could probably get around it by using interfaces. > > In one project we passed a pointer to each DLL, when loaded, > indicating the main form of the calling executable (the form > with this panel is in the USES declaration of the DLL so that > its structure is in the scope of the DLL (though the form > itself is not initialised in the DLL, but only in the calling > program); anything in the .exe main form can be referenced > using this pointer: a panel in the DLL can be planted on the > .exe by redirecting its parent property to the pointer: very > neat (to be safe you need to test that the pointer is not > NULL before using it, and later to destroy the DLL objects on > unloading the DLL from memory, assuming you want to > dynamically load and unload multiple DLLs, as was our case); > > _______________________________________________ > Delphi mailing list -> [email protected] > http://www.elists.org/mailman/listinfo/delphi > >
The problem is that the objects have different signatures (vmts or something). That means that a font in your dll will not be recognised as a font by the calling program and vice versa. That starts to cause problems when you want to dynamically add components to forms etc. That applies to all objects so you end up doing a lot of casting. Regards Sean ----------------------------- Sean Cross Systems Development CRM PO Box 230 Napier Phone: 06 835 5868 Mobile: 027 276 6439 Email: [EMAIL PROTECTED] Disclaimer: "The information contained in this document is confidential to the addressee(s) and may be legally privileged. Any view or opinions expressed are those of the author and may not be those of CRM. No guarantee or representation is made that this communication is free of errors, viruses or interference. If you have received this e-mail message in error please delete it and notify me. Thank you." _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

