在Visual Studio 2017程序中使用外部DLL函数 [英] Consume an external DLL functions in a visual studio 2017 program

查看:194
本文介绍了在Visual Studio 2017程序中使用外部DLL函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每个人都晚上好。



我最近放弃尝试在旧的Access 2010应用程序中使用外部dll功能,它从未工作过;所以我正在尝试使用我正在开发的一个新的项目(程序)作为VS 2017和VB NET的桌面应用程序,使用它作为代理来使用此dll的功能并将结果返回给Access 2010 app。



VS 2017中的程序确实识别dll,它的属性和功能。



I已经连接了两个应用程序,通过剪贴板来回发送必要的参数,甚至将值赋值给它的几个属性。但是当我尝试执行一个公共函数时,程序失败了,调试输出窗口(我说这是正确的)给了我消息(西班牙语):



'Facturacion_Electronica.exe'(CLR v4.0.30319:Facturacion_Electronica.exe):'C:\ Windows \ Microsoft.Net\assembly\GAC_MSIL \FacturacionElectronica \v4.0_1.0.0.0__d18e1c28d757c7cd\FacturacionElectronica .dll'cargado。没有se encuentra el archivo PDB o no se puede abrir。
$ b $bExcepcióproductcida:'System.IO.FileNotFoundException'en Facturacion_Electronica.exe

El programa'[4416] Facturacion_Electronica。 exe'terminóconcódigo0(0x0)。



这意味着类似的东西。 Facturacion_Electronica.dll已加载。无法找到PDB文件或无法打开它。



如果我使用on next resume next语句(只是为了避免程序停止,并分析下一个函数,错误是(或多或少):



公共函数布尔Grabar_Factura丢失或不能找到2



我看到这个函数出现在另一个dll中,可能是在第一个中引用(或调用)我确实可以通过对象浏览器看到该函数。它确实存在,所以我只是不知道,也无法弄清楚为什么它没有在程序中找到。



我真的很感激任何人的帮助或关于在哪里寻找信息来解决这个问题的指示或提示。如果我无法做到这一点,我唯一的选择就是自己开发这个功能,这需要我很长时间。这都是关于电子发票生成。



我尝试过的事情:



我一直在努力解决这个问题,通过互联网寻找一个伟大的时间。我知道我需要继续搜索,但我真的想节省时间。

解决方案

试一试:你可以反汇编它,找到类和方法定义,构建你的.def文件,然后将其用作其他常规DLL。


看一下这篇文章:

从.dll创建.lib文件


Good Evening to everybody.

I recently gave up in trying to consume an external dll functions in an old Access 2010 app, it just never worked; so I'm trying to use a new Project (program) that I'm developing as a desktop application with VS 2017 and VB NET, to use it as a proxy to consume the functions of this dll and returns the results to the Access 2010 app.

The program in VS 2017 indeed recognizes the dll, its attributes and functions.

I already got to connect the two apps, sending back and forth the necessary parameters through the clipboard, and even assignig values to several of its attributes. But when I try to execute a public function, the program fails, and the debug output window (I hpe is correct to say so) gives me the message (spanish):

'Facturacion_Electronica.exe' (CLR v4.0.30319: Facturacion_Electronica.exe): 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\FacturacionElectronica\v4.0_1.0.0.0__d18e1c28d757c7cd\FacturacionElectronica.dll' cargado. No se encuentra el archivo PDB o no se puede abrir.
Excepción producida: 'System.IO.FileNotFoundException' en Facturacion_Electronica.exe
El programa '[4416] Facturacion_Electronica.exe' terminó con código 0 (0x0).

It means something like. "Facturacion_Electronica.dll loaded. The PDB file couldn't be found or it cannot be opened".

If I use the statement "on error resume next" (just to avoid the program from stopping, and analyze the next functions, the error is (more or less):

"public function Boolean Grabar_Factura is missing or it can´t be found2

I saw this function comes in another dll that probably is referenced in (or called from) the first one I indeed can see the function with the object browser. It does exists, so I just don't know and can't figure out why it is not found in the program.

I'd really appreciate anybody's help or indications or hints about where to look for information to solve this problem. If I can't achieve this, the only option that I have left is to develop this functionality by myself, and it it would take me a long time. It's all about an electronic invoice generation.

What I have tried:

I've been trying to solve it, searching thru the internet for a great time. I'm aware I need to keep on searching, but I'd really like to save time.

解决方案

Give a try:You can disassemble it,find the class and methods definitions, build your .def file,then use it as other regular DLL.


take a look at this post:

Create .lib file from .dll


这篇关于在Visual Studio 2017程序中使用外部DLL函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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