home *** CD-ROM | disk | FTP | other *** search
- unit DYNAMAIN;
- { Unit with all User-procedures:
- The procedure 'LetsDoIt' is called, whenever you click the button
- 'Start'
- }
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls;
-
- type
- TForm1 = class(TForm)
- Button1: TButton;
- procedure LetsDoit(Sender: TObject);
- private
- { Private-Deklarationen }
- public
- { Public-Deklarationen }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- // The procedure, which has to be measured, is in the DLL 'EXDLL'
- VAR
- Start : FUNCTION : Integer;
- Lib : THANDLE;
- Loaded : Boolean;
-
- procedure TForm1.LetsDoit(Sender: TObject);
- begin
- Start;
- Start;
- end;
-
- INITIALIZATION
- Loaded := FALSE;
- Lib := LoadLibrary('EXDLL.DLL');
- IF Lib <> 0 THEN BEGIN
- Start := GetProcAddress(Lib, 'Start');
- Loaded := TRUE;
- END;
- FINALIZATION
- IF Loaded = TRUE THEN
- FreeLibrary(Lib);
- END.