S
sky1000
Unregistered / Unconfirmed
GUEST, unregistred user!
type
TStrFunction = Function(FileName:String):String;stdcall;
const
DllName = 'rkdtsttoxml.bpl';
var
Form1: TForm1;
implementation
uses ShareMem;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
H:HModule;
FileName,Slh:String;
TPointer:TFarproc;
StrFunc:TStrFunction;
begin
if not OpenDialog1.Execute then
exit;
FileName:=OpenDialog1.FileName;
H:=0;
H:=LoadPackage(DllName);
try
if H>0 then
begin
TPointer:=GetProcAddress(H,PChar('GetSlh'));//GetSlh是读取一个xml文件,把slh值取出来.但是IPointer是值是空值,不知为什么,有知道的指点一下,头一次调用*.bpl,
if not (TPointer=nil) then
begin
StrFunc:=TStrFunction(TPointer);
Slh:=StrFunc(FileName);
end;
end;
finally
if H<>0 then
begin
UnLoadPackage(H);
H:=0;
end;
ShowMessage(Slh);
end;
end;
TStrFunction = Function(FileName:String):String;stdcall;
const
DllName = 'rkdtsttoxml.bpl';
var
Form1: TForm1;
implementation
uses ShareMem;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
H:HModule;
FileName,Slh:String;
TPointer:TFarproc;
StrFunc:TStrFunction;
begin
if not OpenDialog1.Execute then
exit;
FileName:=OpenDialog1.FileName;
H:=0;
H:=LoadPackage(DllName);
try
if H>0 then
begin
TPointer:=GetProcAddress(H,PChar('GetSlh'));//GetSlh是读取一个xml文件,把slh值取出来.但是IPointer是值是空值,不知为什么,有知道的指点一下,头一次调用*.bpl,
if not (TPointer=nil) then
begin
StrFunc:=TStrFunction(TPointer);
Slh:=StrFunc(FileName);
end;
end;
finally
if H<>0 then
begin
UnLoadPackage(H);
H:=0;
end;
ShowMessage(Slh);
end;
end;