unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
Mystruct =record
NumA,NumB,NumC:integer;
TestA,TestB:shortstring;
str:shortstring;
end;
TForm1 =
class(TForm)
Button1: TButton;
Label1: TLabel;
Button2: TButton;
Label2: TLabel;
Button3: TButton;
Label3: TLabel;
Button4: TButton;
Label4: TLabel;
Label5: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
function Addit(a, b: integer): integer;
cdecl ;
function Mulit(a, b: integer): integer;
cdecl ;
function stringit(a:char): char;
cdecl ;
function recordes(a:Pointer): integer;
cdecl ;
implementation
{$R *.dfm}
function Addit(a, b: integer): integer;
cdecl;
external '
Qtest.dll';
//cdecl
function Mulit(a, b: integer): integer;
cdecl;
external '
Qtest.dll';
//cdecl
function stringit(a:char): char;
cdecl ;
external '
Qtest.dll';
//cdecl
function recordes(a:Pointer): integer;
cdecl ;
external '
Qtest.dll';
//cdecl
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.Caption:=inttostr(Addit(2,3));
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
label2.Caption:=inttostr(Mulit(2,3));
end;
procedure TForm1.Button3Click(Sender: TObject);
var a:char;
begin
a:='
h';
label3.Caption:=Stringit(a);
end;
procedure TForm1.Button4Click(Sender: TObject);
var a:^Mystruct;
begin
new(a);
a^.NumA:=100;
a^.NumB:=200;
a^.NumC:=300;
a^.TestA:='
*Tester';
label4.Caption:=inttostr(recordes(@a^));
label5.caption:=a^.TestB;
dispose(a);
end;
end.