Conditional resources

Started by
2 comments, last by Qoy 24 years, 4 months ago
I am having the same problem. Is it even possible to use #ifndef's in rc2 and rc files? Because I never got it to work...
Advertisement
Well, the thing you have to realize about .rc files is that they aren't C/C++, they're a special scripting language. There are C/C++ #defines and stuff in them, but if you look closely, they aren't actually part of the file, they are script settings for the resource.h file generation and things like that.
You might try putting the stuff you want to flag out in the rc2 and attempting to only define that when in Release, or you might try messing with the resource.h file and seeing if you can remove them there. I haven't tried either so I can't guarantee success. You could also ask on the www.codeguru.com forums, as there might be someone there who has tried it...

-fel

~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
I am making a Pacman clone, and I want to make it so that in the final release, all the pictures and stuff are included as resources, instead of as separate files. The loading of the pictures is no problem, because I can load them from resource, but the problem is I can't seem to make it so that it only includes the picture resource in a release build. I tried adding an #ifdef _DEBUG..#endif pair surrounding the bitmap declaration in the main rc file, but VC++ changed it. Then somebody suggested I use an rc2 file, so I tried that too, but the bitmap is never included in the file!! Can I make it so that it only compiles the picture as a resource if _DEBUG is defined? If so, how?
Any help is appreciated,
Jonathan Little

------------------
http://qoy.tripod.com

I think you gave me an idea. I think I'll try to put something like this in the resource.h file:
#ifdef _DEBUG
#define PICTURE BITMAP DISCARDABLE IDB_IMAGE
#else
#define PICTURE //
or something like that.
Maybe that will work...

This topic is closed to new replies.

Advertisement