🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Loading from resource ??

#1499
From: Dennis Jones
Date: Sat, 21 Jul 2007 16:25
42 lines
1986 bytes
"Asger Jorgensen" <Junk@Asger-P.dk> wrote in message 
news:MPG.210c130d589713669897af@newsgroups.borland.com...
> Hi there
>
> I am trying to loaad an animated cursor from resource,
> this is what i've done.
>
> The .rh file:
>
> #ifndef ICONS_RH
> #define ICONS_RH
>
> #define ID_CURSOR_WORKING  1002
> #endif
> //---------------------------
>
> The .rc file:
>
> #include "Icons.rh"
>
> ID_CURSOR_WORKING  ANICURSOR "Abe.ani"

That looks wrong.  You are using the previously #defined integer value as 
the name of the resource.  I don't have a whole lot of experience with 
resources, but in my RC files, the same thing might look like:

// define a name for the 'working' cursor
CURSOR_WORKING ANICURSOR "Abe.ani"

Then in my code:

LoadCursor( (void *)Hinstance, "CURSOR_WORKING" );

or:

FindResource( (void *)HInstance, "CURSOR_WORKING", RT_ANICURSOR );

Note that I don't have to use MAKEINTRESOURCE (the point of which I've never 
understood anyway!).

- Dennis 
Technical Details
Message-ID: <46a23395$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <MPG.210c130d589713669897af@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,5cbfdb1c42dc78dc
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Dennis Jones" <nospam@nospam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <MPG.210c130d589713669897af@newsgroups.borland.com>
Subject: Re: Loading from resource ??
Date: Sat, 21 Jul 2007 09:25:58 -0700
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 71.245.109.58
Message-ID: <46a23395$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1185035157 71.245.109.58 (21 Jul 2007 09:25:57 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
X-Original-Bytes: 1840