I've got a problem when creating a form from within a DLL. I want my host application to call the DLL to provide a form, and the host should then display the returned form as a child of the host applications main form.
I've had a look at the examples offered in the following question:
and am now passing through the host applications handle through to the DLL. I've got everything pretty much working (ie: no AV's), EXCEPT that if I set the parent property of the DLL-provided form to be the Main form the child form remains invisble after calling show. Not setting the parent property allows the child form to become visible, but it is no longer a child of the main form which is what I require. I suspect that there is more going on than just the child form not being visible, because scrollbars appear on the main form and they don't respond as expected.
NewForm := MyDLL.GenerateForm(Applica
NewForm.Parent := MainForm; // <---- Commenting this out makes the form visible
NewForm.Top := 10;
NewForm.Left := 10;
If the child form is provided by the host application instead of a DLL, there is no problem with making the child form a child of the main form, so I figure that the problem must have something to do with using a DLL.
If anyone has got any suggestions, I'd really like to hear them,
PS. I'm using Delphi 7 personal ed.