🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: HInstance of Package

#4414
From: Dennis Jones
Date: Mon, 06 Feb 2006 18:15
26 lines
2018 bytes
"HF" <ola@ola.gr> wrote in message news:43e75c95@newsgroups.borland.com...
> Hello all,
>
> I have a package which contains a component plus some
resources(bitmaps).In
> real time i want to access these bitmaps
> //**************************************
> Graphics::TBitmap* bb = new Graphics::TBitmap();
> bb->LoadFromResourceName((int)HInstance ,"RES1");
> ...... some code .....
> delete bb;
> //**************************************
>
> I get Exception Error in real time "resource RES1 not found".
> HInstance is of the main application and  cannot find  RES1.How can I
access
> the package to retrieve RES1 ?

If you know the name of the module that contains the resource, you can use
GetModuleHandle() to get its instance handle and use that to load the
resource.  If you do not know the name of the module, you have to enumerate
all of the modules loaded by the application (see LibModuleList) and try
each one until you find the resource you are looking for.

- Dennis
Technical Details
Message-ID: <43e79179$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!195.92.193.196.MISMATCH!nntp.theplanet.net!inewsm1.nntp.theplanet.net!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43e75c95@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,1aa5be8b1f4e1550
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Dennis Jones" <nospam@nospam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <43e75c95@newsgroups.borland.com>
Subject: Re: HInstance of Package
Date: Mon, 6 Feb 2006 10:15:43 -0800
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 204.200.27.7
Message-ID: <43e79179$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1139249529 204.200.27.7 (6 Feb 2006 10:12:09 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!195.92.193.196.MISMATCH!nntp.theplanet.net!inewsm1.nntp.theplanet.net!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail