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
Thema durchsuchen
Ansicht
Themen-Optionen

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
Seite 2 von 2     12   
Benutzerbild von jaenicke
jaenicke

Registriert seit: 10. Jun 2003
Ort: Berlin
9.960 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.960 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
MichaelT

Registriert seit: 14. Sep 2005
Ort: 4020 Linz
558 Beiträge
 
Delphi 10.3 Rio
 
#5

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

  Alt 7. Sep 2024, 17:52
Auch auf die Gefahr hin mich unbeliebt zu machen ....
Zumal der zweite Server eher 'nackt' ist, wurde die passende Visual C/C++ Runtime in 32bit und/oder 64bit installiert?

In einem in MS C/C++ erstellten und damit kompilierten Programm schmiert das Programm in der Regel sang- und klanglos ab. Wenn DLLs geladen werden, dann, sofern es am FireDAC liegt, würde ich einmal an dem Eck suchen.

Ich war zwar ab dem ersten Moment als der FireDAC noch Dent in Version 0.6x hieß dabei, aber mit der 'logischen' DriverID der Driver Link Komponente habe ich mich noch nie intensiv gespielt. Die zeigt bei dir bei der Connection auf die Basis DriverID und in besagter Komponente verweist sie auf einen 2.5er Firebird, sofern ich die Einstellen richtig rate.

Ich bekäme mit der Config vermutlich ein Connection rejected by remote interface.

Moin,

Jeder Hinweis/Idee ist willkommen.

Danke.
  Mit Zitat antworten Zitat
AndreasAutopoll

Registriert seit: 5. Sep 2024
9 Beiträge
 
#6

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

  Alt 9. Sep 2024, 12:47
Danke an alle die versucht haben zu helfen!

Es war natürlich komplet dämlich. In dem Verzeichnis lungerte noch eine steinalte Ressource-Datei <program>.EN rum, die er obwohl alles auf Deutsch ist, in dem WS2022 welches auf einer englischen Installaiton fußt, die dt, ist buggy, griff. Damit hat er aus dem altem Multilizer, den ich nicht mehr einsetzee, irgendwelchen katastrophalen Kram geladen.

Ist ja nichtso, das wir den Bug schon kannten. Nun denn. cu.
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.374 Beiträge
 
Delphi 12 Athens
 
#7

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

  Alt 9. Sep 2024, 13:54
Wie gesagt, eine saubere VM oder einfach nur die Sandbox (extremst abgespeckte Minimalvariante des installierten Windows) sind immer gut, um Abhängigkeiten zu testen.

https://developer.microsoft.com/de-d...tual-machines/
Sowie im Hyper-V gibt es auch direkt eine Auswahl von Vorinstallierten, beim Hinzufügen einer neuen VM.
Ein Therapeut entspricht 1024 Gigapeut.
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 2 von 2     12   

 

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 11:25 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