Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Resource Compiler
 Predefined Macros
Predefined Macros

RC does not support the ANSI C predefined macros (__DATE__, __FILE__, __LINE__, __STDC__, __TIME__, __TIMESTAMP__). Therefore, you cannot include these macros in header files that you will include in your resource script.

RC does define RC_INVOKED, which enables you conditionally compile portions of your header files, depending on whether the compiler is your C compiler or the RC compiler. This is important because the RC compiler supports only a subset of the statements a C compiler would support.

To conditionally compile your code with the RC compiler, surround code that RC cannot compile with #ifndef RC_INVOKED and #endif.

The following example is taken from the SDK samples. It demonstrates how to create a header file that can be compiled conditionally.

#ifndef RC_INVOKED
#pragma message("Including CntrOutl.H from " __FILE__)
#endif

Send comments about this topic to Microsoft

Build date: 7/30/2009

Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker