🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.language.objectpascal
Article #32519

Re: LoadLibrary() fails with EApplicationError Exception

#32519
From: Danny Grava
Date: Fri, 22 Nov 2002 08:28
45 lines
2932 bytes
My impression (based on your description) is, that it tries to create the
application object due to the inclusion of the unit forms.
If you require forms, I think you will need to build your aplication
including your dll with runtime packages on. In that case your dll will use
the VCL package already loaded and share the application instance with your
application.

This is how it works with our plugin system based on bpls.

But perhaps there is a trick to tell your forms in your dll to use the
application object and message queue of your application without using run
time packages.

I am not sure if this is the reason for you problem and perhaps you are
already using run time packages in both your dll and application.


"Gerke Preussner" <j3rky@gerke-preussner.de> wrote in message
news:3dddd294$1@newsgroups.borland.com...
> I used Delphi 5 for quite a long time and successfully implemented
> plugin-based programs in the past. I'm currently migrating to Delphi 7 and
> trying to write a small generic plugin system. Unfortunately, i have
> difficulties getting it to work properly.
>
> Basically, the main program contains a control that will look for DLLs in
> the program folder and load them as plugins. The DLLs contain forms which
> will then be opened by the main program on demand. Loading the DLLs
doesn't
> work and the LoadLibrary() function stops with the following exception:
>
>    "Cannot create application object in shared object or library"
>
> I assume that this is because of the unit 'Forms' used in the DLL which
> attempts to create another instance of TApplication. Neither the main
> program, nor the DLLs are using CLX components/units. I have to admit that
> im lost here... i spent hours making researches in GoogleGroups and the
> Borland Community but i still have no idea how to move on.
>
> It's probably just a tiny little thing i'm missing.
> Any help would be highly appreciated,
>
>
> j3rky
>
>
Technical Details
Message-ID: <3dddeaaa$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.gamma.ru!Gamma.RU!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail
References: <3dddd294$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109d30,fb934d5e10fdceed,start
X-Google-Attributes: gid109d30,public
X-Google-ArrivalTime: 2002-11-22 01:16:42 PST
From: "Danny Grava" <Danny.Grava@Spam.no>
Newsgroups: borland.public.delphi.language.objectpascal
References: <3dddd294$1@newsgroups.borland.com>
Subject: Re: LoadLibrary() fails with EApplicationError Exception
Date: Fri, 22 Nov 2002 09:28:44 +0100
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 195.86.44.8
Message-ID: <3dddeaaa$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1037953706 195.86.44.8 (22 Nov 2002 00:28:26 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.gamma.ru!Gamma.RU!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail