简体   繁体   English

如何将avicap32.dll添加到VS2010

[英]How to add avicap32.dll into VS2010

I'm writing a small code in C# using visual studio 2010 express. 我正在使用Visual Studio 2010 Express在C#中编写一个小代码。 I'm trying to add avicap32.dll from C:\\WINDOWS\\system32 to the "References" but getting an error saying that "A reference to 'C:\\WINDOWS\\system32\\avicap32.dll' could not be added. Please make sure that the file is accessible, and that is a valid assembly or COM component". 我正在尝试将C:\\ WINDOWS \\ system32中的avicap32.dll添加到“参考”中,但出现一条错误消息: “无法添加对'C:\\ WINDOWS \\ system32 \\ avicap32.dll的引用。请进行确保该文件可访问,并且是有效的程序集或COM组件”。 How to get rid of this? 如何摆脱这个?

thanks in advance, 提前致谢,

Sri 斯里

I am not familiar with this library itself, but I've seen this error many times before when trying to work with 3rd party libraries. 我不熟悉此库本身,但是在尝试使用第三方库时,我已经多次看到此错误。 Assuming you've done the diligence in making sure that things are, in fact, accessible and this is not a permissions problem (double check!), this happens when the referenced dll doesn't the .net metadata in it. 假设您已经尽力确保可以访问所有内容,并且这不是权限问题(仔细检查!),当引用的dll中没有.net元数据时,就会发生这种情况。 Sometimes VS can 'figure it out' even if the metadata isn't explicitly present, but oftentimes it can't. 有时VS可以“弄清楚它”,即使没有明确显示元数据,但有时却不能。 This could be for a number of reasons, but most commonly it's because the dll was written in unmanaged code, like C++. 这可能有多种原因,但最常见的是因为dll是用非托管代码(例如C ++)编写的。

The solutions to this problem are always in a little bit of flux depending on the specifics of the DLL you're trying to use, and I don't really have too many details on this library you're trying to add. 根据您要使用的DLL的具体情况,此问题的解决方案总是会不断变化,而对于要添加的该库,我确实没有太多细节。 I picked up a few forum posts that will hopefully set you on the right track, but if not please comment with some extra details so we've got more information to help out. 我挑选了一些论坛帖子,希望可以使您走上正确的道路,但是如果没有,请发表一些额外的评论,以便我们获得更多帮助的信息。 (Pages: 1 2 3 ) (页数: 1 2 3

pInvoke lists many declarations for most of the system dll functions you can try and import. pInvoke列出了您可以尝试导入的大多数系统dll函数的许多声明。 Click on advapi32 in the left menu and you'll get a list of things they have a declaration for. 单击左侧菜单中的advapi32 ,您将获得它们具有声明的内容的列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM