Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Keine Forms in CLX-DLLs? Workaround? (https://www.delphipraxis.net/12357-keine-forms-clx-dlls-workaround.html)

Colonel Chris 25. Nov 2003 22:41


Keine Forms in CLX-DLLs? Workaround?
 
Ich versuche, CLX-Forms in DLLs/SOs abzuspeichern. Leider bekomme ich vom Debugger stets die Fehlermeldung
"Fatal: cannot create application object in shared objects or libraries"
in dem Moment, in dem die DLL (dynamisch) von der Trägerapplikation geladen wird.

Das Problem scheinen die Forms zu sein. Sobald ich Form-Klassen erzeuge, ist die DLL nicht mehr benutzbar. Hat jemand ne Idee, woran das liegen könnte? In der Delphi-Hilfe gibts vage Andeutungen, dass CLX evtl. nur mit Packages funktioniert - ich hoffe nicht!

jbg 25. Nov 2003 22:58

Re: Keine Forms in CLX-DLLs? Workaround?
 
Zitat:

Zitat von Colonel Chris
"Fatal: cannot create application object in shared objects or libraries"

QForms.pas sagt dazu:
Zitat:

Restrictions on CLX and TApplication in external modules:
CLX and Qt allow only a single instance of the application object - it is
created and destroyed in the initialization and finalization sections of
QControls.pas, respectively. It is the user's responsibility when using
external modules (packages and libraries or shared objects) in their
applications to ensure that only a single instance of TApplication is
created. Please heed the following rules when mixing modules that rely on
visual CLX:
- External libraries (.dll's/.so's) may not refer to visual CLX units
directly or indirectly.
- If you wish to include visual CLX code in an external library, the
external library must be a *package* to avoid duplicate unit
initialization and finalization.
- If your package uses the visualclx package, the main application must also
use it, and should not directly link in visual CLX units.
Zitat:

In der Delphi-Hilfe gibts vage Andeutungen, dass CLX evtl. nur mit Packages funktioniert - ich hoffe nicht!
Ein Package ist im Grunde nichts anderes als eine DLL, mit ein paar Erweiterungen.

Du könntest deiner Anwendung und die DLL das VisualClx Package als dependency hinzufügen. (Project/Options.../Packages)

Colonel Chris 25. Nov 2003 23:20

Re: Keine Forms in CLX-DLLs? Workaround?
 
Zitat:

Zitat von jbg
Ein Package ist im Grunde nichts anderes als eine DLL, mit ein paar Erweiterungen.

Du könntest deiner Anwendung und die DLL das VisualClx Package als dependency hinzufügen. (Project/Options.../Packages)

Danke für die Hilfe. Aber gibt es keine andere Lösung? Ich würde schon gern eine DLL/SO machen, der Unabhängigkeit wegen.


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:28 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz