home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
vp21beta.zip
/
AEXMPSRC.RAR
/
DLL
/
TESTDLL2.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
2000-08-15
|
1KB
|
43 lines
{█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█}
{█ █}
{█ Virtual Pascal Examples. Version 2.1. █}
{█ Using an import library █}
{█ ─────────────────────────────────────────────────█}
{█ Copyright (C) 1996-2000 vpascal.com █}
{█ █}
{▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀}
program TestDll2;
// This example demonstrates how to use an Import Library to easily
// import functions from a DLL. First, tell the compiler that we want
// "original" names with no unit names prepended:
{$OrgName+}
// Second, list the functions - by the names they were exported from the
// DLL - with external; directives:
procedure TestProc1; external;
procedure Test2; external;
procedure TestProc3; external;
function TestFunc(a, b: Longint): Longint; cdecl; external;
// Last, tell the linker which import library it can use to look up the
// external entry points:
{$L TSTVPDLL.LIB}
// The import library was generated either by specifying "Use DLL" on the
// Options->Linker page of the IDE, or by using IMPLIB:
// IMPLIB TSTVPDLL.LIB TSTVPDLL.DLL
// Now call the functions of the DLL:
begin
TestProc1;
Test2;
TestProc3;
writeln('3 + 4 is ',TestFunc(3,4));
end.