注册 登录
编程论坛 Delphi论坛

关于DLL的难题请大侠给看一看,指点一下。

lin315 发布于 2010-03-16 11:22, 771 次点击
我的dll文件:
library Project2;
uses
  ShareMem,
  SysUtils,
  Forms,
  Windows,
  Messages,
  Classes;

    Function read(b1:Longint;d1:Longint;a1:pchar):Longint; stdcall ;
    begin
        if (b1=1)and (d1=3) and (a1='123456789')then
           begin
            Result:=0;
            a1:='987654321'
           end
        else
            Result:=1;
    end ;

{$R *.res}
end;
  exports
    read name 'Read';

begin
end.

调用程序的函数:
Function  Read b1:Longint;d1:Longint;a1:pchar):Longint;stdcall;external   'Project2.dll';
var
 tt:pchar;
begin
    tt:='000000';
    Label1.Caption:=inttostr(dogread(6,80,tt));
    Label2.Caption:=tt;   // 想这里的值变为:'987654321'
end
我想在调用这个dll把调用程序中的tt值变为:'987654321',如何才能实现呢?  
3 回复
#2
chenhao198602010-03-16 12:25
undefined
#3
chenhao198602010-03-16 13:40
undefined
#4
kt232010-04-17 19:23
如果 dogread 是 read 的话用传址
1