ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 IEMBitmap.LoadFromResource crashes with
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

933 Posts

Posted - Oct 11 2024 :  10:49:12  Show Profile  Reply
IEMBitmap.LoadFromResource crashes when trying to load the resources from a 64-bit EXE file:



Here is the project to reproduce the error:

attach/PeterPanino/20241011104749_TIEMultiBitmapHelperLoadFromResourceTestv2.zip
86.34 KB

How can the crash be avoided?

The documentation says only: "Appends the specified types of resources from PE files like EXE, DLL, OCX, ICL, BPL, etc from a module, such as an EXE file."

It does not mention 32-bit or 64-bit.

ImageEn 13.6.0
Delphi 12.2
Windows 11

PeterPanino

933 Posts

Posted - Oct 11 2024 :  11:22:45  Show Profile  Reply
I have tried to limit the resource types to Bitmap and GroupIcon:

ImageEnMView1.IEMBitmap.LoadFromResource(ThisExeFile, [ietrBitmap, ietrGroupIcon]);


In this case, the crash does not occur, but the Bitmaps are empty:



It is unclear whether the Bitmaps are shown empty only with this specific EXE file or whether this is a general limitation.
Go to Top of Page

PeterPanino

933 Posts

Posted - Oct 11 2024 :  13:02:47  Show Profile  Reply
I have now improved my project:

1. Loading only GroupIcon resources due to the 64-bit limitation
2. Applying an automatic Filtering system that shows only the icon resources with the largest dimensions in the EXE file

attach/PeterPanino/2024101113138_TIEMultiBitmapHelperLoadFromResourceTestv3.zip
141.03 KB
Go to Top of Page

xequte

38608 Posts

Posted - Nov 04 2024 :  00:54:24  Show Profile  Reply
Hi Peter

Your demo works fine when I test it here on various EXE files. Is there are particular EXE/DLL I should load to reproduce the error?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: