我想这样做:一个MFC工程的Debug版使用1.rc,而Release版使用2.rc,怎么做?

解决方案 »

  1.   

    http://community.csdn.net/Expert/TopicView.asp?id=5117211
      

  2.   

    # ADD RSC /l 0x804 /d "NDEBUG" /d "_AFXDLL" UI3.rc
    改成这样后出现如下错误:
    RC : fatal error RC1107 : invalid usage; use RC /? for Help
      

  3.   

    那就:
    #if defined(_DEBUG)
      #include "1.rc"
    #else
     #include "2.rc"
    #endif
      

  4.   

    就写你工程的资源文件源文件中.比如你工程的 *.rc 文件名为 abc.rc 
    则 abc.rc 内容如下:
    #if defined(_DEBUG)
      #include "1.rc"
    #else
     #include "2.rc"
    #endif// -----------------------------------
    你的 1.rc / 2.rc 的内容可能如下
    // Microsoft Visual C++ generated resource script.
    //
    #include "resource.h"#define APSTUDIO_READONLY_SYMBOLS
    /////////////////////////////////////////////////////////////////////////////
    // 略 ...
    /////////////////////////////////////////////////////////////////////////////
    #endif    // not APSTUDIO_INVOKEDOK ?