I'm using Delphi 11. And I have an application that I compile both 32 or 64 bits target.
For localization of my app, I'm using this code to load my language file on startup.
LoadResStringFunc := nil; // Disable strings caching
NewInstance := LoadLibraryEx(FileName, 0, LOAD_LIBRARY_AS_DATAFILE);
....
LibModuleList.ResInstance := NewInstance;
FileName is a DLL file that has the translated resources (RCDATA and "String Table"). It seems this file to be a 32 bits DLL whatever the 32/64 bits output of the exe file selected.
It works fine with 32 bit image exe file, but does not work anymore with the application compiled to 64 bits application. The error code is a 0XC0000005 Access violation once the
LibModuleList.ResInstance := NewInstance;
is set, and any call to LoadResString() in system.pas . It seems memory is totally corrupted. It came suddenly (or I cannot remember what could cause this). It used to work with 64 bits exe file generated. I totally reseted the translation project from scratch (keeping the previous current one aside), and I have still the same issue. I spend a lot of time trying to figure this out with no success. What could cause this ?