home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vp21beta.zip / AEXMPSRC.RAR / DLL / TESTDLL1.PAS next >
Pascal/Delphi Source File  |  2000-08-15  |  961b  |  28 lines

  1. {█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█}
  2. {█                                                       █}
  3. {█      Virtual Pascal Examples. Version 2.1.            █}
  4. {█      Simple use of DLL example                        █}
  5. {█      ─────────────────────────────────────────────────█}
  6. {█      Copyright (C) 1996-2000 vpascal.com              █}
  7. {█                                                       █}
  8. {▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀}
  9.  
  10. program TestDll1;
  11.  
  12. // In this example, the functions of the DLL are imported using Borland
  13. // Pascal syntax:
  14.  
  15. procedure Test1; external 'TSTVPDLL' index 1;
  16. procedure Test2; external 'TSTVPDLL' name 'Test2';
  17. procedure Test3; external 'TSTVPDLL' name 'TestProc3';
  18. function Add(a, b: Longint): Longint; cdecl; external 'TSTVPDLL' name 'TestFunc';
  19.  
  20. // And the entry points are called:
  21.  
  22. begin
  23.   Test1;
  24.   Test2;
  25.   Test3;
  26.   writeln('3 + 4 is ',Add(3,4));
  27. end.
  28.