在 C++ 中包含 .idl 文件项目

发布于 2024-11-26 05:45:02 字数 261 浏览 0 评论 0原文

我正在用 C++ 构建一个项目,它使用 DirectShow 的视频捕获库连接到相机。视频卡制造商 (BlackMagic) 提供了 .idl(接口定义语言)文件,该文件将新的捕获图添加到标准集合中。

问题是,我从未遇到过 .idl 文件,而且非常模糊的“包含文件”方向并没有多大帮助。用 #include 指令包含它不会引发任何错误,但该程序也无法提取我认为它打算添加的各种定义,因为它是我被告知要包含在项目中的唯一文件。

我的问题是:应该如何在项目中包含 .idl 文件?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柳絮泡泡 2024-12-03 05:45:02
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.

观察:这些步骤是针对 VS2008 进行描述的,但我认为 VS2010 在这个角度上没有什么不同。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文