Including a .idl file in a C++ project
I'm building a project in C++ which uses DirectShow's video capture library to connect to a camera. The video card manufacturer (BlackMagic) has provided .idl (Interface Definition Language) files which add new capture graphs 开发者_如何转开发to the standard collection.
Thing is, I've never come across a .idl file, and the very vague "include the file" direction doesn't help much. Including it with a #include directive doesn't throw up any errors, but the program also fails to pull in the various definitions which I presume it's intended to add, since it's the only file I'm told to include with the project.
My question is: how should one include a .idl file in a project?
For example: you have an AFileName.idl 1. Add the AFileName.idl to you project: Right Click on The project->Add->Existing Item... 2. Click Right on The AFileName.idl from the project->Compile 3. The step 2 will generate AFileName_h.h, AFileName_i.c, AFileName_p.c,... 4. Now you can #include "AFileName_h.h" and use it, you also may need to add AFileName_i.c or other generated files to your project depending on your needs.
Observation: the steps are described for VS2008 but I don't think VS2010 is different in that perspective.
精彩评论