H
hqpeng
Unregistered / Unconfirmed
GUEST, unregistred user!
我在一本书中看到一制作DLL例子,但总是得不到理想的结果.
DLL中有一函数ReverseStr(X),如X='CATFOOD',调用返回值应为:
reverseStr(X)=0,X='DOOFTAC'.
请大侠给出调用的主过程.
DLL源程序如下:
library Reverse;
uses
SysUtils,
Classes;
function ReverseStr(StrToReversechar):integer;export;stdcall;
var
BFGLen:Integer;
Temp:char;
Count:Integer;
begin
BFGLen:=strLen(StrToReverse);
for count:=0 to (BfGLen div 2)-1 do
begin
temp:=strToReverse[count];
strToReverse[count]:=strToReverse[BFGLen-1-Count];
strToReverse[BFGLen-1-Count]:=Temp;
end;
ReverseStr:=0;
end;
exports
ReverseStr;
begin
end.
DLL中有一函数ReverseStr(X),如X='CATFOOD',调用返回值应为:
reverseStr(X)=0,X='DOOFTAC'.
请大侠给出调用的主过程.
DLL源程序如下:
library Reverse;
uses
SysUtils,
Classes;
function ReverseStr(StrToReversechar):integer;export;stdcall;
var
BFGLen:Integer;
Temp:char;
Count:Integer;
begin
BFGLen:=strLen(StrToReverse);
for count:=0 to (BfGLen div 2)-1 do
begin
temp:=strToReverse[count];
strToReverse[count]:=strToReverse[BFGLen-1-Count];
strToReverse[BFGLen-1-Count]:=Temp;
end;
ReverseStr:=0;
end;
exports
ReverseStr;
begin
end.