VS2010中的C ++ DLL - 无效的COM对象 [英] C++ DLL in VS2010 - invalid COM object

查看:89
本文介绍了VS2010中的C ++ DLL - 无效的COM对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在使用C ++编码的DLL时遇到了严重的问题。这是libarary,它提供了一些连接和使用财务打印机的通信协议方法/功能。

每当我尝试在我的项目中添加对此的引用时,VS2010会给我带错误对话框窗口,其中包含信息,这个是不是正确的COM对象。

有人可以给我一些分步手册我该怎么做才能在VB.NET或C#项目中使用这个DLL?我知道这是可能的,但我没有任何关于解决它的信息来源。

我对C ++也不是很熟悉。

Hello guys,
I have a serious problem with some DLL coded in C++. This is libarary which provides some communication protocol methods/functions to connect and use fiscal printer.
Every time I try to add reference to this in my project, VS2010 brings me error dialog window with information, that this is not proper COM object.
Can somebody please give me some step-by-step manual what should i do to use this DLL in VB.NET or C# project? I know this is possible but I don't have any good source of information about solving it.
I'm not very familiar with C++ also.

推荐答案

对.DLL的引用,如果它们是COM公开的或.NET .DLL的。如果你不能设置它的引用,你必须使用P / Invoke并导入库导出的函数并直接调用它们。



你需要知道函数头及其参数和返回类型是为了做到这一点。我希望你有文件证明这一点,因为它几乎不可能猜到。
References to .DLL's only work if they are COM exposed or .NET .DLL's. If you can't set a reference to it you have to use P/Invoke and import the functions the library exports and call them directly.

You will need to know the functions headers and their parameter and return types in order to do this. I hope you have the documentation that spells this out because it's all but impossible to guess at.


这篇关于VS2010中的C ++ DLL - 无效的COM对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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