{$R *.RES} Type TComplex = record Re, Im: Real;
end; function AddC(x, y: TComplex): TComplex; stdcall; begin ResultJm := x.Im + y.Im;
Result.Re := x.Re + y.Re end; function SubC(x, y: TComplex): TComplex;
stdcall; begin ResultJm := x.Im - y.Im;
Result.Re := x.Re - y.Re
end; function MulC(x, u: TComplex): TComplex;
stdcall; begin Result.Re := x.Re * y.Re + x.Im * y.Im;
ResultJm := x.Re * y.Im - x.Im * y.Re
end; function DivC(x, y: TComplex): TComplex;
stdcall; var z: Real;
begin
42
begin end. Bu yerda stdcall bu DLL ga Delphi dan boshqa tillardan murojaat
qilishga imkon beradi. Agar bibliotekaga faqat Delphi tilidagi dasturdan
murojaat qilinsa, bu so‘zning keragi yo‘q.
Qism dasturlariga murojaat qilish uchun ularni quyidagicha e’lon
qilish lozim:
Procedure MyProc; External 'M yDLL';
Agar indeks bo‘yicha chaqirish lozim bo‘lsa:
Procedure MyProc; External ' MyDLL' index 2;
Bundan tashqari dasturchi tashqi nomni o‘zgartirishi ham mumkin:
Procedure MyProc; External 'MyDLL' Name 'ExtName';
Foydalanish Statik vuklash
Dasturda Cmpix bibliotekasi quyidagicha e’lon qilinishi lozim.
Type
43
Exteraal 'Cmplx' index 3;
function DivC(x, y: TComplex): TComplex; stdcall;