🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.deployment
Article #29

Re: TForm loaded from dll not showing on parent form (when Build with Runtime packages unchecked)

#29
From: Mark Guerrieri
Date: Tue, 17 May 2005 17:06
53 lines
3098 bytes
From the help for TApplication->Handle :

"Note: When writing a DLL that uses VCL forms, assign the window handle of
the host EXE's main window to the DLL's
Application.HandleApplication->Handle property. This makes the DLL's form
part of the host application. Never assign to the Handle property in an
EXE."

In your DLL, implment a method where you can pass in a handle.  In the DLL,
save the existing TApplication->Handle value and replace it with the
passed-in handle.  On DLL shutdown, restore the original handle.

Mark

"Ondrej Gratz" <gratzo@atlas.cz> wrote in message
news:4284ec37@newsgroups.borland.com...
> Hello, everybody !
>
> /*******************************************/
> ide: Borland C++ Builder 6 Build 10.166,
>   all actual updates applied.
>
> Please download attachment from borland.public.attachments, "Form loaded
> from dll ATTACH" post. It's only 10 kB. I've tried to keep paths
> relative, so you should have no problem compiling it under BCB6.
> /*******************************************/
> I'll try to keep it short. I've created very simple application to
> demonstrate my problem.
> After you compile both projects (one of them is an EXE, the other is a
> DLL), run server.exe.
> On the main menu, press Show DLL form. Form loaded from the DLL appears
> on the main form workspace.
>
> Now in both projects uncheck "Build with runtime packages" on the
> Packages tab in the project Options dialog.
> Again, compile projects and run the application.
>
> /* The problem: now you can't see the DLL form. */
> The function that shows the form is located in
> client.bpr/client_main.cpp, r.49.
>
> I know the actual application's bad. But it's my first implementation of
> an application with dynamically loadable modules. That's a great concept
> for me, but the first solution is bad.
>
> Unfortunatelly I've found this problem after a big part of the
> application has been completed. I don't want to ship all of the runtime
> libraries with the project, so I appreciate any ideas.
>
> Thanks very, very much for replies.
>
> Sincerely
> Ondrej Gratz
Technical Details
Message-ID: <428a247b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4284ec37@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: f8e54,6ea2f7e8f3bca168
X-Google-Attributes: gidf8e54,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mark Guerrieri" <mguerrieri@nospam_cmsgrp.com>
Newsgroups: borland.public.cppbuilder.deployment
References: <4284ec37@newsgroups.borland.com>
Subject: Re: TForm loaded from dll not showing on parent form (when Build with Runtime packages unchecked)
Date: Tue, 17 May 2005 13:06:03 -0400
Lines: 55
Organization: Creative Marketing Strategies
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 209.50.174.82
Message-ID: <428a247b@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1116349563 209.50.174.82 (17 May 2005 10:06:03 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail