Article View: borland.public.cppbuilder.nativeapi
Article #1498Loading from resource ??
From: Asger Jorgensen
Date: Sat, 21 Jul 2007 11:57
Date: Sat, 21 Jul 2007 11:57
53 lines
1999 bytes
1999 bytes
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"
//---------------------------
I have added the .rc file to my project and the exe file
is bigger now.
in the Form::OnShow i do:
HCURSOR hCursor = LoadCursor((void*)HInstance,
MAKEINTRESOURCE(ID_CURSOR_WORKING));
but hCursor is NULL.
If i do this:
HCURSOR hCursor = LoadCursorFromFile(CursorFile.c_str());
every thing works fine.
I have also tryed:
HRSRC hRsrc = FindResource( HInstance,
MAKEINTRESOURCE(ID_CURSOR_WORKING),
RT_ANICURSOR
);
but FindResource also returns NULL
when I look at my exe file with the XN Resource Editor
I can see that there is a group called ANICURSOR and a lot of data
under the ID 1002
Anybody who knows what I am doing wrong ??
Thanks in advance
Asger
Technical Details
Message-ID:
<MPG.210c130d589713669897af@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder2.cambrium.nl!feed.tweaknews.nl!193.201.147.68.MISMATCH!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,5cbfdb1c42dc78dc,start X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Asger Jorgensen <Junk@Asger-P.dk> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Loading from resource ?? Date: Sat, 21 Jul 2007 13:57:20 +0200 Message-ID: <MPG.210c130d589713669897af@newsgroups.borland.com> Organization: Asger-P MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit User-Agent: MicroPlanet-Gravity/2.70.2067 NNTP-Posting-Host: 83.73.213.92 X-Trace: newsgroups.borland.com 1185019154 83.73.213.92 (21 Jul 2007 04:59:14 -0700) Lines: 54 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder2.cambrium.nl!feed.tweaknews.nl!193.201.147.68.MISMATCH!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail