緊急求教,在VB里怎樣調用Delphi寫的dll?

yxh_bear 2000-10-31 08:29:00
我用Delphi寫的dll,
請問在VB里,怎樣調用,
它報錯說,約定錯誤,
請幫忙告訴我.
謝謝!
...全文
54 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
王集鹄 2000-10-31
  • 打赏
  • 举报
回复
//对于Delphi Dll中不能用string做接口
//看看我的Dll
library PicturesPr;

uses
SysUtils,
Classes,
Windows,
Forms,
PictureUnit in 'PictureUnit.pas' {FormPicture},
FunctionUnit in 'FunctionUnit.pas';

{$R *.RES}

var
V_FileName: string; //图形文件名
V_OnShowForm: TNotifyEvent; //显示窗体的事件
V_OnCloseForm: TNotifyEvent; //关闭窗体的事件

procedure SetOnShowForm(mOnShowForm: TNotifyEvent); stdcall;
begin
V_OnShowForm := mOnShowForm;
end;

procedure SetOnCloseForm(mOnCloseForm: TNotifyEvent); stdcall;
begin
V_OnCloseForm := mOnCloseForm;
end;

function GetFileName: PChar; stdcall;
begin
Result := PChar(V_FileName);
end;

procedure SetFileName(mFileName: PChar); stdcall;
begin
V_FileName := string(mFileName);
end;

procedure ExeFormPicture; stdcall;
var
vFileName: TFileName;
begin
vFileName := TFileName(V_FileName);
DoFormPicture(vFileName, V_OnShowForm, V_OnCloseForm);
V_FileName := PChar(vFileName)
end;

exports
ExeFormPicture, GetFileName, SetFileName, SetOnShowForm, SetOnCloseForm;

end.


5,392

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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