dll 호출

4625 단어 dll
Procedure aaaaaaa(CorpName: PChar; CorpAccount,
ActualCorpName: PChar; var Amount: Double; FiscalComments: PChar;
ErrorCode,ErrorMessage: PChar);
stdcall; external 'ccc.dll';

TCorpRecord = record
CorpAccount,
ActualCorpName,
FiscalComments,
ErrorCode,
ErrorMessage: PChar;
Amount: Double;
end;
procedure TFrom1.CropQuery;
var
CorpRecord: TCorpRecord;
CorpName: string;
begin
CorpName:='233';
With CorpRecord do
begin
GetMem(CorpAccount,11);
GetMem(ActualCorpName,256);
GetMem(Fiscalcomments,256);
GetMem(ErrorCode,3);
GetMem(ErrorMessage,256);
try
aaaaaaa(pchar(CorpName),CorpAccount,ActualCorpName, Amount, Fiscalcomments,
ErrorCode, ErrorMessage);
if (ErrorCode='00')or(ErrorCode='02')or(ErrorCode='03')then
showmessage('success!');
finally
FreeMem(CorpAccount);
FreeMem(ActualCorpName);
FreeMem(Fiscalcomments);
FreeMem(ErrorCode);
FreeMem(ErrorMessage);
end;
end;

end;
var
LibHandle:THandle;
implementation

function LoadLib_Talent: HMODULE;
begin
Result := LibHandle;
if LibHandle=0 then
if not FileExists('ccc.dll') then
showmessage(' ccc.dll')
else
Result := LoadLibrary('ccc.dll');
end;

function FreeLib_Talent: BOOL;
begin
Result := false;
if LibHandle <> 0 then
begin
Result := FreeLibrary(LibHandle);
LibHandle := 0;
end;
end;
 

 
 

좋은 웹페이지 즐겨찾기