DLL问题!用D6写一DLL可用vb6调用出错!高手帮忙看看

hgf_hb 2004-02-16 08:53:45
delphi的代码如下:
library test1;

{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }

uses
SysUtils,
Classes;

{$R *.res}

function funstr(tstr:pchar):pchar;
begin
result:=tstr;
end;

exports
funstr;
begin
end.

vb6的代码如下:
Private Declare Function funstr Lib "test1.dll" (ByVal Fstr As String) As String
在一按钮地单击事件里调用出错,提示dll调用约定出错
text2.text=funstr(text1.text)
高手帮帮忙!谢谢!!!
...全文
28 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复

5,390

社区成员

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

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