如何将DLL中引用函数(C语言格式)转为VB定义格式???

genius00 2003-12-24 08:33:23
高手请教啊!!!
如何将DLL中引用函数(C语言格式)转为VB定义格式?
例如:
typedef struct _DRIVER_INFO_OK
{
char ModalNumber[40];
char SerialNumber[20];
char ControlNum[8];
DWORD DriveType;
DWORD Cylinders;
DWORD Heads;
DWORD Sectors;
} DRIVER_INFO_OK, *PDRIVE_INFO_OK;

int ReadPhysicalDriveInNT(const int idrive,PDRIVE_INFO_OK buf,int buflen)
其中,buf变量是指针.

上面的定义在VB中如何引用啊!!!

...全文
498 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Greaitm 2004-03-02
  • 打赏
  • 举报
回复
这种问题怎么每天都看到?
younghust 2004-03-02
  • 打赏
  • 举报
回复
supergreenbean(超级绿豆) 回答应该是对的。
DLL 与 VB 数据类型对应表
类型 C 语言中的声明 VB 中的声明
8 位数值参数 char chMyChar ByVal chMyChar As Byte
BYTE chMyByte ByVal chMyByte As Byte
16 位数值参数 short nMyShort ByVal nMyShort As Integer
WORD wMyWord ByVal wMyWord As Integer
32 位数值参数 int nMyInt ByVal nMyInt As Long
UINT wMyUint ByVal nMyUint As Long
BOOL bMyBool ByVal nMyBool As Long
DWORD dwMyDWord ByVal dwMyDWord As Long
LONG lMyLong ByVal lMyLong As Long
浮点数 float MyFloat ByVal MyFloat As Single
double MyDouble ByVal MyDouble As Double
变体 VARIANT MyVar ByVal MyVar As VARIANT
VARIANTARG MyVar ByVal MyVar As VARIANT
句柄 HWND hWnd ByVal hWnd As Long
HPEN hPen ByVal hPen As Long
HGLOBAL hglbl ByVal hglbl As Long

--
supergreenbean 2004-03-02
  • 打赏
  • 举报
回复
Public Type DRIVER_INFO_OK
ModalNumber(39) As Byte
SerialNumber(19) As Byte
ControlNum(7) As Byte
DriveType As Long
Cylinders As Long
Heads As Long
Sectors As Long
End Type

Public Declare ReadPhysicalDriveInNT Lib "xx.dll" (ByVal idrive As Long ,buf As DRIVE_INFO_OK,ByVal buflen As Long) As Long

dz08039 2004-03-01
  • 打赏
  • 举报
回复
我也想知道
SoHo_Andy 2003-12-24
  • 打赏
  • 举报
回复
搜索一下以前的帖子吧,讨论过很多次了
genius00 2003-12-24
  • 打赏
  • 举报
回复
楼上的仁兄,

那不是WINDOWS里的DLL
是VC编的DLL , 如何转换啊???
JB-Zhang 2003-12-24
  • 打赏
  • 举报
回复
Visaul Studio6里有个APIView,在里面查就可以了,它会以VB格式把DLL里面的API原型显示给你的,你把经复制到程序里就OK了

7,785

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧