Skip to main content
gamedev.net
🔒 Locked

Loading custom resources...

Started by elis-cool 4 replies 200+ views
Original Post
elis-cool
elis-cool
I cant get this working... heres the code
  
// From script1.rc

.
.
.
/////////////////////////////////////////////////////////////////////////////

//

// 50

//


IDR_501                 50      DISCARDABLE     "Overlay.tga"
IDR_502                 50      DISCARDABLE     "titledefault.tga"
IDR_503                 50      DISCARDABLE     "titlehover.tga"
#endif    // English (New Zealand) resources

/////////////////////////////////////////////////////////////////////////////

.
.
.

// Exact code in my .cpp

HRSRC hRsrc = FindResource(0, "Overlay.tga", "50");
//HRSRC hRsrc = FindResource(0, "Overlay.tga", "#50"); // also tryed this

if(hRsrc) MessageBox(0, "Working", 0,0);  

MasterDepot
[email=esheppard@gmail.com]esheppard@gmail.com[/email]
Oxyacetylene
Oxyacetylene
I remember there was something I had to do to load resources using a string filename rather than an integer. Can''t remember what it is off the top of my head though. I will have a look to see if I can find the code when I get home.
elis-cool
elis-cool
Got it!

  
HRSRC hRsrc = FindResource(0, MAKEINTRESOURCE(IDR_501), "#50");

I had tryed the two things seperately, but not together...


MasterDepot
[email=esheppard@gmail.com]esheppard@gmail.com[/email]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.