Using preprocessor directives in an IDL file

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: joarvat (joarvat_at_discussions.microsoft.com)
Date: 08/20/04


Date: Fri, 20 Aug 2004 02:11:02 -0700

Hi, I wanted to use preprocessor directives of the form

#ifdef _SOMETHING
        uuid(9980BD04-FDEB-4C53-BF57-E54087048DF0),
        version(3.5),
        helpstring("MS FAST CSDefault 3.5 Type Library")
#else
        uuid(0aa674ef-9ac5-4d69-9ca6-69a666681aac),
        version(1.1),
        helpstring("MS CombiMat CSDefault 1.1 Type Library")
#endif

in the .idl file of a project. According to documentation, you should be
able to define a preprocessor macro for the MIDL preprocessor in the project
settings MIDL tab (preprocessor definitions edit box). However, I can't see
any evidence that this is working. If I define my symbol, it is not
recognized by the preprocessor.

I'm using Visual Studio C++ 6.

Does anyone have a clue to how this should work?



Relevant Pages

  • Several Problems with Attribute handling in ATL with VS2005
    ... know if there's a way to write those two methods verbatim to the IDL file. ... tried idl_quote but had no success. ... Hopefully I'm just missing something ... Some attributes do not recognize the C++ preprocessor. ...
    (microsoft.public.vc.atl)
  • Re: Using preprocessor directives in an IDL file
    ... Try using a custom build step for your IDL file and type the ... whole MIDL line there plus your -D_SOMETHING. ... Microsoft MVP, MCSD ... > able to define a preprocessor macro for the MIDL preprocessor in the ...
    (microsoft.public.vc.atl)
  • Re: gcc 4.3 warnings
    ... A few people at work have mentioned it seems unusual for a preprocessor ... A macro definition has to consist of a sequence of tokens. ... A string ... preprocessor documentation. ...
    (Fedora)
  • Re: gcc 4.3 warnings
    ... A few people at work have mentioned it seems unusual for a preprocessor to complain about simple macros this way. ... A macro definition has to consist of a sequence of tokens. ... A string ... The preprocessor is being used to generate html code documentation in the build, ...
    (Fedora)
  • Re: Is there a Perl Module The Does GCC like precompile on C++ files ?
    ... >>>I want to take an IDL file and preprocess it ... ... preprocessor, and will not forkor execany external process. ... Sinan Unur ...
    (comp.lang.perl.misc)