![]() |
AW: Nach Update auf Delphi12 startet compiliertes Prog nicht mehr. Fehler bei LoadRes
Nja, die gnuGetText hookt halt die ResourceString-Funktionen.
Je nach Version/Umsetung könnte man diesen Teil aber auch entfernen/deaktivieren, falls man nur selbst "manuell" Texte übersetzten wollte, z.B. mit der _()-Funktion. Wer weiß was XSBuiltIns macht |
AW: Nach Update auf Delphi12 startet compiliertes Prog nicht mehr. Fehler bei LoadRes
Zitat:
Zitat:
Zitat:
|
AW: Nach Update auf Delphi12 startet compiliertes Prog nicht mehr. Fehler bei LoadRes
Große Freude!
Danke für die Info. Zitat:
|
AW: Nach Update auf Delphi12 startet compiliertes Prog nicht mehr. Fehler bei LoadRes
This line is cause :
![]()
Code:
// replace Borlands LoadResString with gettext enabled version:
HookLoadResString:=THook.Create (@system.LoadResString, @LoadResStringA); The implementation of both LoadResStringA and LoadResStringW are not compatible system.LoadResString. ![]()
Code:
This override casting by hooking between string and widestring cause Delphi memory manager to corrupt memory at arbitrary places and luckily for you it happens at the stack at this stage !
// Unicode-enabled way to get resourcestrings, automatically translated
// Use like this: ws:=LoadResStringW(@NameOfResourceString); function LoadResString(ResStringRec: PResStringRec): widestring; function LoadResStringA(ResStringRec: PResStringRec): ansistring; function LoadResStringW(ResStringRec: PResStringRec): widestring; Though this behavior might be easier to be found by using resource leak finder like Nexus Quality Suite Code Watch ![]() Or may be even any memory corruption tracker could find it earlier, like FastMM in full debug, MadShi, EurekaLog, or Code Watch. Why Code Watch ? because it is sensitive for hooking as it does use them, so confliction or hidden hooks could be found easier. |
AW: Nach Update auf Delphi12 startet compiliertes Prog nicht mehr. Fehler bei LoadRes
Zitat:
Der Orignal-Autor Lars Dybdahl, ist schon seit Jahren von der Bildfläche verschwunden. Zuletzt habe ich diese Unit und die zugehörigen Tools mehr oder eher weniger gepflegt, weil ich noch Zugriff auf das Repository habe. Unter Delphi 12 habe ich sie allerdings nie getestet und vermutlich funktioniert sie auch nicht mit FMX und schon gar nicht mit anderen Platformen als Win32. Die aktuelle Version gibt es übrigens auf ![]() |
AW: Nach Update auf Delphi12 startet compiliertes Prog nicht mehr. Fehler bei LoadRes
Zitat:
Delphi-Quellcode:
// Unicode-enabled way to get resourcestrings, automatically translated
// Use like this: ws:=LoadResStringW(@NameOfResourceString); function LoadResString(ResStringRec: PResStringRec): widestring; function LoadResStringW(ResStringRec: PResStringRec): UnicodeString; function PLoadResString(const szMsgCtxt: MsgIdString; ResStringRec: PResStringRec): widestring; function PLoadResStringW(const szMsgCtxt: MsgIdString; ResStringRec: PResStringRec): UnicodeString;
Delphi-Quellcode:
No idea whether this fixes the problem, but I use it for most of our internal tools at work with Delphi 2007 and 10.2 and haven't experienced any inexplicable AVs.
// replace Borlands LoadResString with gettext enabled version:
{$ifdef UNICODE} HookLoadResString:=THook.Create (@system.LoadResString, @LoadResStringW); {$else} HookLoadResString:=THook.Create (@system.LoadResString, @LoadResStringA); {$endif} That code is from at least 2012 (when it was copied to SourceForge from now defunct Berlios, so any older history is lost). That version you found must be even older. But on the other hand, the dxgettext project dates back to the 1990ies where it of course started out as non-Unicode-aware. |
AW: Nach Update auf Delphi12 startet compiliertes Prog nicht mehr. Fehler bei LoadRes
Never used gnugettext or DxGetText in my life ! so yes i am not sure which is the latest or maintained.
In all cases these functions should not even consider using widestring to begin with, these with widestring should be removed, and as for declaring a specific function with unicodestring or ansistring is also not my favorite, they just should be string, to be future proof with RTL yet backward compatible. |
AW: Nach Update auf Delphi12 startet compiliertes Prog nicht mehr. Fehler bei LoadRes
Hey Gerd,
da sind wir ja froh, dass es nicht an Delphi 12 gelegen hat.... Gruß :D Michael |
AW: Nach Update auf Delphi12 startet compiliertes Prog nicht mehr. Fehler bei LoadRes
Zitat:
|
AW: Nach Update auf Delphi12 startet compiliertes Prog nicht mehr. Fehler bei LoadRes
// bringt hier gar nichts - Denkfehler
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:31 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