CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2002
    Posts
    60

    #ifdef in .rc2 file in release version does not work!

    Hi,
    I'm defining IDR_MAINFRAME and AFX_IDS_APP_TITLE in my .rc2 file depending enviornment variable. (its in .rc2 because in .rc file Microsoft does not accept #ifdef).

    In debug version it works great but in release version it doesn't work. It seems that definitions are not recognized in release version at all.

    Here is the code from .rc2 file:
    #if defined FIRST
    STRINGTABLE DISCARDABLE
    BEGIN
    IDR_MAINFRAME "First Console\n\nFirst\nFirst Files (*.frs)\n.frs\nFirst.Document\nFirst File"
    AFX_IDS_APP_TITLE "First Console"
    END
    #elif defined SECOND
    STRINGTABLE DISCARDABLE
    BEGIN
    IDR_MAINFRAME "Second Console\n\nSecond\nSecond Files (*.frs)\n.frs\nFirst.Document\nFirst File"
    AFX_IDS_APP_TITLE "First Console"
    END
    #endif

    It is quite urgent. Does anyone has an idea why in release version it doesn't work?

  2. #2
    Join Date
    Feb 2002
    Posts
    60
    O.K.
    It seems that I know the reason why.
    We need to add the enviornemnt variable to the preprocessor definitions in the resource tab in project settins (and not only in the c/c++ tab, general in combo box int the project settings).
    I only put it for the debug version.

    But I have another question. While searching for differences between debug and release in the project settings I found that my release version does use precompiled header and the debug version does not.
    Is there a reason why not using precompiled header (stdafx.h)? is there a reason why in debug we will not use it and in release we will?

  3. #3
    Join Date
    Sep 2003
    Location
    Forever Gone... For Now...
    Posts
    1,515
    Probably the reason is because someone changed it. When the project is created, all configurations are set up the same way with regards to precompiled headers.
    Thought for the day/week/month/year:
    Windows System Error 4006:
    Replication with a nonconfigured partner is not allowed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured