有一个第三方厂商提供的DLL,是使用他们产品的。DLL库带了一个.H文件,里面有类似这样的定义:#ifdef XXXX_EXPORTS
#define XXXX_ERROR 0x0001
#else
#define XXXX_ERROR 0x0002
#endifDWORD WINAPI XXXX_Sign (HANDLE devNo,
unsigned char *pFileid,
unsigned char *pData,
short nlen,
short ndatatype,
short nType);typedef struct {
unsigned int bits;
int a;
char *b;
} U_KEY;我现在想在VB里调用这个函数,想请问一下,在VB里该如何定义?尤其是数据类型应该和VB里的如何对应?
此外,这个DLL还带有一个.LIB,也需要在VB里定义吗?我从来没有做过这方面的事情,在CSDN查了半天也没找到很确切的定义,很希望能得到大家的帮助。
unsigned char *pFileid,
unsigned char *pData,
short nlen,
short ndatatype,
short nType);
-----------------------
Declare Function XXXX_Sign Lib "DLL文件名称.DLL" _
(Byval devNo As Long, _
ByRef pFileid As Byte, _
ByRef pData As Byte, _
ByVal nLen As Integer, _
ByVal ndataType As Integer, _
ByVal nType As Integer) As Longtypedef struct {
unsigned int bits;
int a;
char *b;
} U_KEY;
------------
Type U_KEY
bits As Long
a As Long
b As String
End Type这个DLL还带有一个.LIB,也需要在VB里定义吗?
-----------
不需要
非常感谢,我去试试。能再麻烦介绍一下常量怎么定义吗?比如在头文件里是0x0001,在VB里应该怎么写?
------------Const 常量名称=&H1