Board index » delphi » Creating Form in DLL built with Runtime Packages

Creating Form in DLL built with Runtime Packages

In EXE:

ShowMyForm(Application.Handle)

In DLL:

procedure ShowMyForm(H: THandle)
begin
    Application.Handle:= H;
    MyForm:= TMyForm.Create(Application);
    MyForm.ShowModal;
    MyForm.Free;
end;

When I build EXE and DLL without runtime packages,  the MyForm is part
of the Application and not shown separately
in the Task Bar. But with runtime packages the MyForm appears in the
Task Bar and Applcation.Handle=0. Why???

Thanks before,

Ivan Titov.

 

Re:Creating Form in DLL built with Runtime Packages


Quote
In article <388F1F1D.C8180...@mail.ru>, Ivan Titov wrote:
> ShowMyForm(Application.Handle)

> In DLL:

> procedure ShowMyForm(H: THandle)
> begin
>     Application.Handle:= H;

Do not do this if you build with packages, all your modules will use the
same Application object in this case.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Sent using Virtual Access 5.00 - download your freeware copy now
http://www.atlantic-coast.com/downloads/vasetup.exe

Re:Creating Form in DLL built with Runtime Packages


Quote
"Peter Below (TeamB)" wrote:
> In article <388F1F1D.C8180...@mail.ru>, Ivan Titov wrote:
> > ShowMyForm(Application.Handle)

> > In DLL:

> > procedure ShowMyForm(H: THandle)
> > begin
> >     Application.Handle:= H;

> Do not do this if you build with packages, all your modules will use the
> same Application object in this case.

Nevertheless in EXE Application.Handle=0 and form is shown separately in
taskbar.
But Application.Handle>0 if I remove all DLL function calls in EXE, or if I
build both
projects without runtime packages.

Thanks for reply,
I hope to get answer again,

Ivan Titov

Other Threads