Using directives in Resource File

Posted on 2008-11-13
Medium Priority
Last Modified: 2013-12-14
I am using the directive   "#if defined(MACHINING_CTR)" in the resource (.RC) file.  If I put a "#define MACHINING_CTR" command in the .RC file then the #if directive works correctly.  However if instead of using the "#define" statement, I define the MACHINING_CTR as a Preprocessor Definition then the "#if" directive does not work.  Does the resource file not recognize Preprocessor Definitions?
Question by:jimrichmond
LVL 39

Accepted Solution

itsmeandnobodyelse earned 500 total points
ID: 22953385
>>>> Does the resource file not recognize Preprocessor Definitions?
No, the resource file was compiled by the resource compiler (rc) and not by C++ compiler which firstly invokes the C/C++ precompiler.

You can add directives for the rc when opening the resource file and go to 'Edit - Resource Includes ...'. Here you have two multi-line edit boxes where you could add #include or #define statements. Or you use global environment variables which should work as well.

Author Closing Comment

ID: 31516508
Thank you for the help

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question