DLL from Pascal
12-Oct-91 10:24:07
Sb: #2718-DLL from Pascal
Fm: Rick Sands/OR 70274,103
To: David Dorosh 76625,2337
Here is a Turbo Pascal DLL skeleton:
LIBRARY Pas;
Uses WinTypes, WinProcs;
Function FileExist(Filename:pChar):Integer; EXPORT; { <<– NOTE }
var Fp:File;
begin
assign(Fp, Filename);
{$I-} reset(Fp,1); {$I+} { Open file as Binary }
if IOResult = 0 then { Did it open? }
begin
FileExist := -1; { VB True }
Close(Fp) { Don't forget to close }
end
else
FileExist := 0 { VB False }
end;
EXPORT FileExist Index 1; { <<– NOTE }
begin
end.
In VB,
Declare Function FileExist Lib "PAS.DLL" (byval Filename as String) as
Integer;