是德科技
直播中

范召琳

8年用户 144经验值
私信 关注
[问答]

如何以这种方式加载DLL库以及程序中的程序?

各位大家好,我现在正试图用Agilent VEE Pro 9.2与Win-I2CUSBDLL板对话/控制。但是,我认为可以实现这一目标的唯一方法是通过DLL编程板。我想知道是否有人可能
能够帮助我如何以这种方式加载DLL库以及程序中的程序。非常感谢你的帮助,非常感谢你的时间,幻影

以上来自于谷歌翻译


     以下为原文

  Hello everybody,

I'm currently trying to speak to/control a Win-I2CUSBDLL board with Agilent VEE Pro 9.2.
However, the only way that I believe this can be achieved is by programming the board through DLL.
I am wondering if anyone may be able to help me with how to load DLL libraries as well as program in the program this way.

Any help is appreciated and thank you very much for your time,

Phantom  

回帖(2)

王文娥

2019-6-20 08:49:13
首先,请注意本手册没有说明64位兼容性.dll有一个C接口,所以你将加载一个已编译的函数库。
就数据类型而言,short int只是短的,uchar是BYTE(除非参数是splatted,在这种情况下它是char *)。
对于那些返回uchar的函数,我不完全确定,但看起来这是一个简单的错误枚举,所以你可能最好把它留在BYTE。
如果这些函数中的任何一个返回指针(我没有看到任何),那会使事情变得复杂。他们明确声明他们使用stdcall调用约定,但他们没有说他们是否在抑制名称修改,所以你可能会
必须为导出的函数名称转换一下。
例如,I2CRead可以是简单的I2CRead,也可以是_I2CRead@8.-SHAWN-

以上来自于谷歌翻译


     以下为原文

  First off, note that the manual doesn't say anything about 64-bit compatibility.

The dll has a C interface, so you'll be loading a compiled function library. As far as data types go, short int is just short, uchar is BYTE (unless the parameter is splatted, in which case it's char *). For those functions that return uchar, I'm not entirely sure but it looks like this is a simple error enum, so you're probably best off to leave it at BYTE. If any of these functions return pointers (I didn't see any), that complicates matters a bit.

They explicitly state that they use the stdcall calling convention, but they don't say if they're suppressing name-mangling so you might have to cast around a bit for the exported function name. For instance, I2CRead may be simple I2CRead, or it may be _I2CRead@8.
-SHAWN-
举报

范召琳

2019-6-20 09:02:46
感谢Chang和Shawn的回复!我已经弄明白问题是什么了。正如你所提到的,这确实是一个定义文件问题。谢谢你的帮助!
他们非常感谢!幻影

以上来自于谷歌翻译


     以下为原文

  Thank you Chang and Shawn for your replies!
I have already figured out what the problem was.
As you mentioned, it was indeed a definition file issue.

Thanks again for all your help! They are highly appreciated!

Phantom
举报

更多回帖

发帖
×
20
完善资料,
赚取积分