gpt4 book ai didi

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

转载 作者:IT老高 更新时间:2023-10-28 22:37:19 24 4
gpt4 key购买 nike

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

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

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

最佳答案

For example: you have an AFileName.idl1. 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->Compile3. 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 在这方面没有什么不同。

关于c++ - 在 C++ 项目中包含 .idl 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6811736/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com