Preprocessor Directives
#if / #ifdef / #else / #elif / #endif
Normally, every conditional block is imported, regardless of whether the #if expression is TRUE or not.
#ifdef _DEBUG
STRINGTABLE DISCARDABLE
BEGIN
IDS_VERSIONSTRING "Debug version"
END
#else
STRINGTABLE DISCARDABLEaaa
BEGIN
IDS_VERSIONSTRING "Release version"
END
#endif
In this example, both string tables are imported.
Certain keywords are treated as "defined" or "undefined". In this case, the #if/#ifdef expression is evaluated. The conditional block that is not imported will be written to the target file unchanged.
These are the keywords that are processed by default. The list can be modified for a given RC file. (see Options for RC Source Files)
| RC_INVOKED | defined |
| PASSOLO_INVOKED | defined |
| APSTUDIO_INVOKED | undefined |
Example:
#if defined(APSTUDIO_INVOKED)
... // This block is read by RC_PARSE
#else
... // This block is not read by RC_PARSE
#endif
You can use PASSOLO_INVOKED to mark blocks in the RC file that should not be imported.
#ifndef PASSOLO_INVOKED
... // This block is not read by RC_PARSE
// but it will be compiled into the .res file
#endif
#include
Embedded files are not read by the RC file parser. If these files are to be localized, you will have to add them to the Passolo project individually. It is also possible to translate the file path. Passolo lists the corresponding files as #include resources. You can modify the path so that it points to the translated version of the file.
This example shows the modified #include paths for an MFC application. Translated versions of afxres.rc and afxprint.rc are included with the MFC. To translate to another language, you will have to add afxres.rc to your project.
#define / #undef
RCParser does not evaluate #define or #undef expressions.