AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Windows 2022 Server, mit Delphi erstelltes exe hat Fehler

Windows 2022 Server, mit Delphi erstelltes exe hat Fehler

Ein Thema von AndreasAutopoll · begonnen am 5. Sep 2024 · letzter Beitrag vom 9. Sep 2024
Antwort Antwort
Benutzerbild von jaenicke
jaenicke

Registriert seit: 10. Jun 2003
Ort: Berlin
9.961 Beiträge
 
Delphi 12 Athens
 
#1

AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler

  Alt 6. Sep 2024, 11:52
Du könntest versuchen, die Komponenten auf dem Datenmodul manuell zu erstellen. Dann solltest du besser sehen, welche Komponente das Problem verursacht.
Sebastian Jänicke
AppCentral
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
412 Beiträge
 
#2

AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler

  Alt 6. Sep 2024, 12:17
Du könntest versuchen, die Komponenten auf dem Datenmodul manuell zu erstellen. Dann solltest du besser sehen, welche Komponente das Problem verursacht.
Will not work always, or better to say, might not catch the reason, on the contrary will work fine without a problem, as you don't always need to RegisterClass to use it or create it at runtime.

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.
Kas
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
412 Beiträge
 
#3

AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler

  Alt 6. Sep 2024, 12:29
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:
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.
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
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.
Kas
  Mit Zitat antworten Zitat
Benutzerbild von jaenicke
jaenicke

Registriert seit: 10. Jun 2003
Ort: Berlin
9.961 Beiträge
 
Delphi 12 Athens
 
#4

AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler

  Alt 6. Sep 2024, 19:44
Will not work always, or better to say, might not catch the reason, on the contrary will work fine without a problem, as you don't always need to RegisterClass to use it or create it at runtime.
This might well be the case. But in this case the solution is very simple:
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.
Sebastian Jänicke
AppCentral
  Mit Zitat antworten Zitat
omnibrain

Registriert seit: 11. Nov 2022
83 Beiträge
 
Delphi 11 Alexandria
 
#5

AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler

  Alt 6. Sep 2024, 21:13
Ist deine Anwendung 64 Bit? Wenn ja würde ich eine Wette eingehen, dass du ein Pointer-Problem hast.
Deaktiviere zur Probe einmal mindesten HE-ASLR oder ASLR gleich ganz und probiere es nochmal aus.
  Mit Zitat antworten Zitat
freimatz

Registriert seit: 20. Mai 2010
1.490 Beiträge
 
Delphi 11 Alexandria
 
#6

AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler

  Alt 7. Sep 2024, 06:34
ASLR wird von madexcept seit 5.1.3 unterstützt. Vielleicht eine alte Version?
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
412 Beiträge
 
#7

AW: Windows 2022 Server, mit Delphi erstelltes exe hat Fehler

  Alt 7. Sep 2024, 07:52
Will not work always, or better to say, might not catch the reason, on the contrary will work fine without a problem, as you don't always need to RegisterClass to use it or create it at runtime.
This might well be the case. But in this case the solution is very simple:
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.
You are you there , i missed this idea, still hooking is faster and less code, in case OP is lazy like me.
Kas
  Mit Zitat antworten Zitat
Antwort Antwort

 
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:35 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