Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Home » Tip Bank » C++
Language: C++
Expertise: Beginner
Apr 5, 2002

Adding C++ Specific Code into IDL Files


When you write an IDL file and need to add specific C++ code in the header file created after MIDL compilation, you can use the the cpp_quote(" ") IDL construct. For example:
 
import "unknwn.idl"

cpp_quote(" //This will go to header file")
cpp_quote(" #ifdef _MYLIBSEARCH ")
cpp_quote(" #pragma comment(lib,\"uuid.lib\")")
cpp_quote(" #endif")

interface IX : IUnknown
{
 ...
}

Before the age of COM, projects generally had main and common header files for the entire project. Now there are shareable IDL files for many projects, but the language for the project is still C++. This is a convenient way to sync all the users of an IDL file for a correct header file generation.
Igal Ioffe
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date