Dll 的问题

BaiYangSpirit 2005-05-14 12:35:03
我用VC里编了一个动态连接库mydll.dll,其中有一个函数如下:
int hf(int n,int w[],char str[])

在VB中调用时:
private Declare Function hf lib "mydll.dll"
(ByVal n As integer,ByRef w,ByRef aa) as Integer

dim aa as String;
dim bb (1 to 100) as integer;

if (hf(8,bb,aa) = 1) then MsgBox aa

出错

VB报错 dll调用错误。
……如之奈何??
...全文
76 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
jerry 2005-05-14
  • 打赏
  • 举报
回复
private Declare Function hf lib "mydll.dll"
(ByVal n As Long,ByRef w,ByRef aa) as Integer
qrlvls 2005-05-14
  • 打赏
  • 举报
回复
将 int hf (int n, int w[], char str[])
改成
extern "C" int hf (int n, int w[], char str[])
试试
lxcLinuxer 2005-05-14
  • 打赏
  • 举报
回复
SAFEARRAY

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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