使用Microsoft Visual C#2010 Express加载DLL [英] Loading DLLs with Microsoft Visual C# 2010 Express

查看:487
本文介绍了使用Microsoft Visual C#2010 Express加载DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Microsoft C#2010 Express与来自Imperx的FrameLink Express驱动程序。当我尝试在运行时加载DLL时,我收到一个例外:


无法加载DLL'VCECLB.dll':指定的模块不能找到
。 (HRESULT的异常:0x8007007E)


如果我尝试添加该DLL作为参考,我得到这个消息:


无法添加对C:\\VCECLB.dll的引用。请
确保该文件可访问,并且它是一个有效的程序集
或COM组件。


两个问题:


  1. 这是一个Express问题(即Express导致问题的一些限制)?我相信DLL的源码是用C ++编写的,但我不会认为这样会很重要。


  2. 有没有不同的方法来引用DLL /或添加到项目?我在做错什么?


最后,我尝试添加x86和x64版本,调试和发布。同样的失败,每次添加为参考。

解决方案

该DLL似乎不是.NET(或COM)代码 - 因此您无法加载它,也不能添加参考它。



与您的Express版本没有任何关系 - 它只是不是一个.NET兼容的DLL,因此您无法加载或引用它。 p>

为了使用其功能,您可能需要深入了解更多的奥秘(以及更复杂和更复杂的)从.NET调用原始C ++代码的方法 - 或找到一个.NET兼容的对应或版本。


I'm using Microsoft C# 2010 Express with the FrameLink Express drivers from Imperx. When I try to load the DLL at runtime, I get an exception:

Unable to load DLL 'VCECLB.dll': The specified module could not be found. (Exception from HRESULT:0x8007007E)

If I try to add the DLL as a reference, I get this message:

A reference to 'C:\\VCECLB.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.

Two questions:

  1. Is this an Express problem (i.e. some limitation with Express causing the problem)? I believe the source for the DLL is written in C++, but I wouldn't think that would matter.

  2. Is there a different way to reference the DLL and/or add it to the project? Something I'm doing wrong?

Finally, I've tried adding both the x86 and x64 versions, debug and release. Same failure to add as a reference every time.

解决方案

That DLL doesn't seem to be .NET (nor COM) code - therefore you cannot load it, nor add a reference to it.

Doesn't have anything to do with your Express version - it's just not a .NET "compatible" DLL and thus you can't load or reference it.

In order to use its functionality, you'll probably have to dive into more "arcane" (and more elaborate and more complicated) methods of calling raw C++ code from .NET - or find a .NET compatible counterpart or version of it.

这篇关于使用Microsoft Visual C#2010 Express加载DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆