Click here to Skip to main content
15,885,065 members

conditional compilation flags in odl file

Rajesh G Manwani from Mumbai asked:

Open original thread
What is equivalent of #ifdef ... #endif flags in .odl files? Is it possible that in odl file, we shall have interface methods which are compiled conditionally ?

e.g.
interface {

methods:
   HRESULT func1([in] inputvar, [out] outvar);
   HRESULT func2([in] inputvar, [out] outvar);
   
   #ifdef THIRDPARTYDLL
   HRESULT func11([in] inputvar, [out] outvar);
   HRESULT func21([in] inputvar, [out] outvar);
   #endif
}

I am using a third-party library for which I have limited run-time and developer licenses. Some of the interface methods are in direct support of library methods.

On some machines where I have license installed, I want to compile with flag on and on other machines, I want to compile with flag off.

How this can be achieved? Also, it is possible to use a flag which defined in source files, in IDL file? In visual studio, there are facilities for defining pre-processor in project. But set of preprocessors for C/C++ source files and for MIDL files is different? can they be shared or can they be inherited from some common place?
Tags: C++, Visual C++ 10.0, Win32

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900