Preprocessor symbols ignored in .RC file

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



(I posted this question in another group that is related to resource
talk, but there's SO little activity I had to post it here too. Sorry
to those who might be annoyed by that.)

Hi,

I am trying to set up the version info so that the exe file has
different info in the version fields, depending on one of my
preprocessor values.

I created a configuration that has the string _W98 in the
Configuration Properties C/C++ Preprocessor tab. Then I tried using
the following inside the .rc file

--------------------------
#ifdef _W98
VALUE "FileVersion", "0.74 W98"
#else
VALUE "FileVersion", "0.74"
#endif
---------------------------

But when I view the .exe file's version info using explorer, there is
no W98 in the File Version field.

I also tried using a duplicate VS_VERSION_INFO resource in the .rc
file with a condition of _W98, the same as the preprocessor symbol and
the file version field in the .exe doesn't change to the proper value
I want it to have.

This is the first time I've tried using a conditional build to change
version info. Is there something I'm doing wrong?

I'm using Visual Studio .Net 2003 with an MFC project.

Thanks,
.



Relevant Pages

  • RE: Windows Installer removes embedded resource manifest ?
    ... The built deployment project never got the modified ... ..EXE file. ... echo %INPUT% manifest resource NOT applied to %BINOUTPUT% ... embedding the necessary .manifest resource as you suggest. ...
    (microsoft.public.vsnet.general)
  • Re: How to load resorces of a form that is not loaded
    ... There is a *very* complicated API - updateresource I believe - but I've never seen a successful VB demo of it. ... picture on a form) using the VB resource editor, you can reference those from anywhere within your application to display as required wherever you want. ... I don't care if they are stored as standard resources or like the forms does, embedded somehow in the exe, as long as I can access then later at any time when the exe is compiled. ...
    (microsoft.public.vb.general.discussion)
  • Re: Manifest file for an Ocx
    ... Finally just add Minium.res as a Resource ... your EXE. ... Now to see if it works with an OCX! ... This has to have a User Control to host the controls for the ...
    (microsoft.public.vb.general.discussion)
  • Re: ERROR_RESOURCE_TYPE_NOT_FOUND error comes
    ... resource handle, save it, set it to the desired resource handle, load the resource, then ... This lib is also having a dependency of DLL. ... bitmap in one of the class of static lib using LoadBitmap but it ... locale ID, and if not found, is defaulted to the app .exe itself. ...
    (microsoft.public.vc.mfc)
  • Re: Digitally sign only a portion of an EXE
    ... I would just put your string table and dialog templates in a separate ... That way you can use conventional methods to sign the exe ... > excluding resources in the message digest, ...
    (microsoft.public.platformsdk.security)