Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在C++;项目 我正在用C++构建一个项目,它使用DirectShow的视频捕获库来连接到相机。视频卡制造商(BlackMagic)提供了.idl(接口定义语言)文件,可将新的捕获图添加到标准集合中_C++_Visual Studio 2010_Directshow_Idl - Fatal编程技术网

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

在C++;项目 我正在用C++构建一个项目,它使用DirectShow的视频捕获库来连接到相机。视频卡制造商(BlackMagic)提供了.idl(接口定义语言)文件,可将新的捕获图添加到标准集合中,c++,visual-studio-2010,directshow,idl,C++,Visual Studio 2010,Directshow,Idl,问题是,我从来没有遇到过.idl文件,而且非常模糊的“包含文件”方向也没有多大帮助。将其包含在#include指令中不会抛出任何错误,但该程序也无法引入我认为它打算添加的各种定义,因为它是我被告知要包含在项目中的唯一文件 我的问题是:如何在项目中包含.idl文件 For example: you have an AFileName.idl 1. Add the AFileName.idl to you project: Right Click on The project->Add->Exist

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

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

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. 例如:您有一个AFileName.idl 1.将AFileName.idl添加到项目:右键单击项目->添加->现有项。。。 2.右键单击项目->编译中的AFileName.idl 3.步骤2将生成AFileName_h.h、AFileName_i.c、AFileName_p.c、,。。。 4.现在,您可以包含“AFileName_h.h”并使用它,您可能还需要 将文件名_i.c或其他生成的文件添加到项目中 根据你的需要。
观察:这些步骤是针对VS2008描述的,但我认为VS2010在这个角度上没有什么不同。

如果您确实在项目中添加了一个.c文件,您可能还必须将文件的c/c++| Advanced |“Compile As”属性更改为“Compile As c Code(/TC)”,并且可能还必须设置文件的c/c++|预编译头“Precompiled header”属性设置为“Not using Precompiled header”,很可能您不需要将.IDL包含到项目中,或者有一种更简单和/或更好的方法来实现您试图实现的目标。