求救,如何在VB中调用DLL中函数

freebernie 2000-08-11 01:14:00
DLL用VC++编写,是一个常规的DLL。函数原型是
int func(unsigned char* param1, unsigned char* param2, int n);
我想知道在VB中如何声明函数原型,如何定义实参,和如何调用。
函数读取param1数组的值,处理后再写到param2的数组。
...全文
159 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
就如同申明API一样
Janven 2000-08-11
  • 打赏
  • 举报
回复


ATOM ByVal variable As Integer
BOOL ByVal variable As Long
BYTE ByVal variable As Byte
CHAR ByVal variable As Byte
COLORREF ByVal variable As Long
DWORD ByVal variable As Long
HWND, HDC, HMENU ByVal variable As Long
INT, UINT ByVal variable As Long
LONG ByVal variable As Long
LPARAM ByVal variable As Long
LPDWORD variable As Long
LPINT, LPUINT variable As Long
LPRECT variable As type 自 定 义 类 型 的 任 意 变 量
LPSTR, LPCSTR ByVal variable As String
LPVOID variable As Any 任 何 变 量( 在 传 递 字 符 串 的 时 候 使 用ByVal)
LPWORD variable As Integer
LRESULT ByVal variable As Long
NULL As Any 或 ByVal Nothing 或 ByVal variable As Long ByVal 0& 或 VBNullString
SHORT ByVal variable As Integer
WORD ByVal variable As Integer
WPARAM ByVal variable As Long
hyzx2000 2000-08-11
  • 打赏
  • 举报
回复
请注意VC中的int对应VB中的Long
Wingsun 2000-08-11
  • 打赏
  • 举报
回复
declare function func lib "Dllname"(byval Param1 as String,byVal Param2 as string,byval n as integer) as integer
hyzx2000 2000-08-11
  • 打赏
  • 举报
回复
Declare Function func Lib "你的dll文件名"(ByVal param1 As String, ByVal param2 As string, ByVal n As Long) As Long

7,759

社区成员

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

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