Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Mar : Re: Forms within DLL

www.cryer.info
Managed Newsgroup Archive

Re: Forms within DLL

Subject:Re: Forms within DLL
Posted by:"Thorsten Dittmar" (nospam@dithosoft.de)
Date:Fri, 4 Mar 2005 00:43:30

Hi

I like to export a function from the dll, like

function CreateMyForm(AOwner: TComponent): TForm; export;
begin
   Result := TMyForm.Create(AOwner);
end;

There is the problem, however, that a) the return type must be a TForm
as the application doesn't know about the form's class and b) you must
add ShareMem as described in the comment the DLL wizard creates.

Did you consider using a package instead of a DLL? That would make
things a little easier I'd suppose.

Regards
Thorsten

Monzer George Yazigi schrieb:
> Hi
> I'm writing an application which calls my custom made own dialogs. The
> dialogs are placed in a DLL.
>
> When calling the dialog from within a DLL, I need to create the dialog
> form:
>
> Form1:=TForm1.Create();
>
> What should be used as a param for Create Method. do I need to pass
> the parent form from the main application? can I pass the form Handle?
> if yes, how to do so?
>
> Regards

--

Please don't reply to this message
via eMail. Your message will not
be read.

Thank you for not sending spam!

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive