Vb -> Delphi (DLL的调用问题)

blueshu 2003-09-27 03:58:16
Delphi中声明
function exportfile(AHandle: THandle;p_id:pchar;p_dir:pchar;p_user:pchar):pchar;
Vb中声明
Private Declare Function exportfile Lib "wdata" (ByVal AHandle As Long, ByVal p_id As String, ByVal p_dir As String, ByVal p_user As String) As String
调用代码
If exportfile(SJCL_XZ.hwnd, sFileID, sDZ_Server, sZDRID) = "1" Then
End If
执行时错误提示
实时错误'5'
无效的过程调用或参数
...全文
68 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
blueshu 2003-09-27
  • 打赏
  • 举报
回复
还是不行
海牛 2003-09-27
  • 打赏
  • 举报
回复
参数类型正确吗?
wx05 2003-09-27
  • 打赏
  • 举报
回复
调用的时候要用别名,名称有没有什么问题
rainstormmaster 2003-09-27
  • 打赏
  • 举报
回复
Delphi中应声明为
function exportfile(AHandle: THandle;p_id:pchar;p_dir:pchar;p_user:pchar):pchar:stdcall:export试试

参考http://hub.myrice.com/delphizt/cxyy/040.htm
rainstormmaster 2003-09-27
  • 打赏
  • 举报
回复
Delphi中应声明为
function exportfile(AHandle: THandle;p_id:pchar;p_dir:pchar;p_user:pchar):pchar:stdcall:export试试

参考http://hub.myrice.com/delphizt/cxyy/040.htm
blues_hu 2003-09-27
  • 打赏
  • 举报
回复
有啊
我的也有stdcall的,不行啊就是上面的错
rainstormmaster 2003-09-27
  • 打赏
  • 举报
回复
Delphi中应声明为
function exportfile(AHandle: THandle;p_id:pchar;p_dir:pchar;p_user:pchar):pchar;stdcall

rainstormmaster 2003-09-27
  • 打赏
  • 举报
回复
是delphi函数的问题,因为delphi生成的dll要供vb调用,所以必须声明函数调用方式为stdcall(stdcall是Windows的标准调用方式,可以在所有支持API调用的语言中使用)
yijiansong 2003-09-27
  • 打赏
  • 举报
回复
Delphi中声明
function exportfile(AHandle: THandle;p_id:pchar;p_dir:pchar;p_user:pchar):pchar;

是否是标准调用?

7,789

社区成员

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

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