|
|
|
|
![]() ![]() |
Mar 21 2008, 11:26 AM
Post
#1
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 2 Joined: 20-March 08 Member No.: 29,263 |
In this example, we are going to use a Form, 2 text box (which the user should enter the both real numbers) and a button. See the Source example:
unit usadll; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Button1: TButton; Edit1: TEdit; Edit2: TEdit; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; function Max(a, b : double):double;stdcall; var Form1: TForm1; implementation {$R *.DFM} function Max(a, b : double):double;external 'MaxDLL'; procedure TForm1.Button1Click(Sender: TObject); var x, y, resultado : double; begin x := StrToFloat(Edit1.Text); y := StrToFloat(Edit2.Text); resultado := Max(x,y); ShowMessage('Valor Máximo ' +FloatToStr(resultado)); end; end. (That's it.. Thank you) |
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
Lo-Fi Version | Time is now: 7th July 2008 - 03:47 PM |