views:

88

answers:

3

Hello, I have an application that I make a call to a DLL function that creates and returns a form. I get a whole bunch of errors when I try to parent this new form to the main form in the application.

Is that a common error / problem or is there not an issue with parenting in this case.

And as far as I have learned a form created in a DLL call doesn't belong to the application. Is there a way to make the newly created form belong to the application.

Thank you, Tim

+1  A: 

Do not use VCL inside DLLs. You will encounter all kind of problems this way. If you absolutely need to have dynamic packages that create VCL components or other GUI parts, use BPLs for instance. Here is a short sumary of both:

  1. BPL vs. DLL
  2. Stack oveflow question

There are other aproaches. Now the main question is why do you create a form inside DLL and is that really needed?

Runner
A: 

Your dll and exe must be compiled in same version of RAD Studio and both must use runtime packages.

Torbins
A: 

compile your dll and exe with the same version of delphi compiler with the same runtime packages.
also in dll do not use any calling convension like stdcall or cdecl on your form-creating-function.
it will work like a charm.

bahadir