🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #5707

Problems with LoadImage and ResInstLoad

#5707
From: Mike Collins
Date: Wed, 20 Jul 2005 01:14
29 lines
1910 bytes
Hi all, having a problem loading images from a resource file using LoadImage 
and / or ResInstLoad.

I have all the images for my application stored in a resource file within a 
DLL, which I dynamically link to at run-time.  One of the images within the 
resource is intended to be used in an ImageList.  At runtime I try to load 
the images into the ImageList, thus:

      istTBIcoHot->Clear();
      istTBIcoHot->ResInstLoad((unsigned int)hGfxHandle, rtBitmap, 
"TOOLBAR_HOT_24_256", clFuchsia);

However, the images are not loaded correctly, there shown in 16-bit colour, 
not 256 (looks crap)

Tried to do the same thing using LoadImage:

      istTBIcoHot->Handle = (unsigned int)LoadImage(hGfxHandle, 
"TOOLBAR_HOT_24_256", IMAGE_BITMAP, 0, 0, LR_DEFAULTSIZE);

still the same thing.  I know that the images are stored correctly in the 
resource / DLL because I've used a reource hacker (ExeScope) and I can see 
them stored as they were intended.

Any ideas?

Thanks in advance

Mike C
Technical Details
Message-ID: <42dda33d@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,3637b9fcce8b4510,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mike Collins" <its@thebottomofthe.post>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Problems with LoadImage and ResInstLoad
Date: Wed, 20 Jul 2005 02:14:16 +0100
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
NNTP-Posting-Host: 81.2.92.14
Message-ID: <42dda33d@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1121821501 81.2.92.14 (19 Jul 2005 18:05:01 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail