![]() |
AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler
Zitat:
Aber warum es auf dem einen PC scheppert und auf dem anderen nicht, das erschließt sich mir leider gar nicht. |
AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler
Zitat:
|
AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler
I think can't find component is misleading error message and simply hide the real error.
I suggest to build a new and an empty project and start to add these component (you listed in DFM) one by one, BUT do the following: 1) try add them at design time, might be caught the culprit. 2) Create them at runtime and get the real exception, the one that TReader had eat. In case that fail too, or may be as different approach, use DDetours ![]() |
AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler
After thinking, may be the shortest way to to hook RegisterClass and log into a file, by comparing the result between 2 OSs you will find the failed one.
|
AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler
Zitat:
|
AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler
Zitat:
|
AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler
Du könntest versuchen, die Komponenten auf dem Datenmodul manuell zu erstellen. Dann solltest du besser sehen, welche Komponente das Problem verursacht.
|
AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler
Zitat:
What i think of is : RegisterClass being called conditionally and these condition weren't met on that OS, hence that skipped register caused the absence of the TComponent or TClass ... exception. This could be buggy code, outdated, a fix was applied only in one place... etc. Catching it red-handed will be clearer and simpler, or may be just search for conditionally called RegisterClass in these DB units might do. |
AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler
On my XE8, an empty VCL project does in fact call RegisterClass only once for TMenuItem, so OutputDebugString might be enough as the list might be short.
Here is a full hooking unit
Delphi-Quellcode:
lcHookRegisterClass should be the first in in the uses clauses in the dpr file, or the second if there is Memory Manger unit is used, something like this
unit lcHookRegisterClass;
interface uses Classes, Windows, DDetours; //procedure InstallHook; type TRegisterClassProc = procedure(AClass: TPersistentClass); var TrampolineRegisterClass: TRegisterClassProc; implementation procedure InterceptRegisterClass(AClass: TPersistentClass); begin TrampolineRegisterClass(AClass); // call the original to register, we don't break the application // AClass.ClassName to log , file or OutputDebugString ... OutputDebugString(PChar(AClass.ClassName)); // OutputDebugString need Windows in uses clause end; procedure InstallHook; begin // Classes.RegisterClass , we use full name and path to the proc if possible to prevent confusion as there is Windows API as RegisterClass if not Assigned(TrampolineRegisterClass) then TrampolineRegisterClass := InterceptCreate(@Classes.RegisterClass, @InterceptRegisterClass); end; initialization InstallHook; finalization if Assigned(TrampolineRegisterClass) then InterceptRemove(@TrampolineRegisterClass); end.
Delphi-Quellcode:
program Project10;
uses lcHookRegisterClass in 'lcHookRegisterClass.pas', Vcl.Forms, uMain in 'uMain.pas' {Form10}; {$R *.res} begin Application.Initialize; Application.MainFormOnTaskbar := True; Application.CreateForm(TForm10, Form10); Application.Run; end. |
AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler
Zitat:
You only have to switch the components one by one or in groups from designtime to runtime. This way you can easily find the component, which is causing the error. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:29 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