![]() |
Re: Feststellen ob Anwendung die VCL verwendet
Zitat:
Delphi-Quellcode:
...beim Programmstart einen eigenen Prozessor für die Events festlegen oder auf den oben beschriebenen manuellen Modus umschalten. Macht man gar nichts wird bei der ersten Verwendung der Notify-Funktionalität der Standard ausgewählt. Entweder der TAcVCLNotifyProzessor oder eben der TAcNonVCLNotifyProcessor.
{Allows you to set an own instance of a notification processor. This method has to be called before any other notification system procedure has been used.
@seealso(TAcNotifyProcessor)} procedure AcNotifyManualSetProcessor(ANotifyProcessor: TAcNotifyProcessor); {If you've initialized the notification queue system using the AcNotifyManualInit function, you must use this function to synchronize the notifications with the thread calling AcNotifyManualProcessQueue. @seealso(AcNotifyManualInit)} procedure AcNotifyManualProcessQueue; {Initializes the notification system with TAcManualNotifyProcessor, allowing you to use the AcNotifyManualProcessQueue function. @seealso(AcNotifyManualProcessQueue)} procedure AcNotifyManualInit; Ich möchte eben nur irgendwie automatisch den Standardprozessor setzen... |
Re: Feststellen ob Anwendung die VCL verwendet
Also letztlich geht es ja um die Synchronize-Methode, oder? Wäre es da nicht u.U. einfacher zu prüfen, ob die "Maschinerie", die den internen Synchronize-Queue abarbeitet, existiert, als zu prüfen, ob die VCL eingebunden wurde? Ich habe da beim Überfliegen der Synchronisations-methoden in der Unit Classes den globalen Funktionszeiger "WakeMainThread" gefunden. Auf den ersten Blick scheint er ein ganz gutes Indiz zu sein:
Delphi-Quellcode:
Ich habe es nur kurz anhand einer neu erstellten VCL-Applikation bzw. einer leeren Konsolenapplikation getestet, dort lieferte der Test aber jedenfalls das korrekte Ergebnis.
if Assigned(WakeMainThread) then
// VCL else // NonVCL |
Re: Feststellen ob Anwendung die VCL verwendet
Hallo,
dein Code funktioniert - auch mit Lazarus wird korrekt auf das vorhandensein der LCL (bzw. eines Handlers für Synchronize, was in der Tat das ist, was ich eigentlich möchte) hingewiesen. :thumb: Vielen Dank, Andreas |
Alle Zeitangaben in WEZ +1. Es ist jetzt 06: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