Does anyone have a run-time fix for CreateInOutError raising an EInOutError with Code=3 (correct) and Message='Invalid file name - %s' (incorrect because SysUtils should have used System.SysConst not System.RTLConst and System.RTLConst wrongly duplicates some resource strings in System.SysConst) See http://qc.embarcadero.com/wc/qcmain.aspx?d=129530
Report From: Delphi-BCB/Compiler/Delphi/Exceptions [ Add a report in this area ]. Report #: 129530, Status: Open. Exception message for "Invalid file name" has superflous "- %s". Project: Delphi, Build #: 21.0.17017.3725. Version: 21.0, Submitted By: Jost Riedel. Report Type: Minor failure / Design ...
no plus ones
Shared publicly•View activity
- procedure HookResourceString(rs: PResStringRec; newStr: PChar);
VirtualProtect(rs, SizeOf(rs^), PAGE_EXECUTE_READWRITE, @oldprotect);
rs^.Identifier := Integer(newStr);
VirtualProtect(rs, SizeOf(rs^), oldprotect, @oldprotect);
HookResourceString(@SInvalidFileName, 'Ongeldige bestandsnaam');
or does it break the other dialog without the %s?
If yes, just change it back after you have passed the critical code.19h
- code actually using RTLConst would expect the correct string and about any file in operation can throw this exception.
I've never done deep code patching before, but I was hoping for a fox that patches the const array inside CreateInOutError18h
- you could patch it in the dcu's directly in the bde installation. x86/x64 debug/release (4 places)
dcu32int / debug window could help finding the place18h
(Code: 3; Ident: SInvalidFilename),
(Code: 3; Ident: System.SysConst.SInvalidFilename),
Nevermind, looking into the sources just change the text with the above mentioned code it should be ok.
Even if you want to be more verbose you shouldn't just rely on the exception messages.18h
- not when you link to the shipping BPLs (yes, the project is that hard).8h