I am using C++Builder. I have 70 small bitmap images in a .res file.
My code using MyBitMap->LoadFromResourceID works and loads the bitmap from the .res file.
TBitmap *MyBitMap = new Graphics::TBitmap();
MyBitMap->LoadFromResourceID( (int)HInstance, 2 );
delete MyBitMap;
MyBitMap=NULL;
The code below using MyBitMap->LoadFromResourceName gives the error "raised exception class EResNotFound with message 'Resource cp2.bmp not found'."
TBitmap *MyBitMap = new Graphics::TBitmap();
const UnicodeString MyName = "cp2.bmp";
MyBitMap->LoadFromResourceName((int)HInstance, MyName );// Error Here
delete MyBitMap;
MyBitMap=NULL;
Here is the top of my .rc file. I have setup all the bitmaps with an ID number and the file name. Loading using the name does not work. Can you show how to use LoadFromResourceName. Thanks.
99 BITMAP "cp0.bmp"
1 BITMAP "cp1.bmp"
2 BITMAP "cp2.bmp"
3 BITMAP "cp3.bmp"
4 BITMAP "cp4.bmp"
5 BITMAP "cp5.bmp"
6 BITMAP "cp6.bmp"
7 BITMAP "cp7.bmp"
8 BITMAP "cp8.bmp"
9 BITMAP "cp9.bmp"
I tried every solution I could find in Google, the Embarcadero Wiki Docs and on ChatGPT.