-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUForm.pas
More file actions
73 lines (62 loc) · 1.7 KB
/
Copy pathUForm.pas
File metadata and controls
73 lines (62 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
unit UForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, ComObj,
Dialogs, StdCtrls, jpeg, ExtCtrls, Grids, DBGrids, DB, ComCtrls;
type
TFrmTest = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Image1: TImage;
ds: TDataSource;
DBGrid1: TDBGrid;
Button2: TButton;
Button3: TButton;
StatusBar1: TStatusBar;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
XObjIntf: OleVariant;
ACustumerObj,ACustTable: Variant;
procedure WMDestroy(var Message:TMessage); message WM_DESTROY;
public
{ Public declarations }
constructor Create2(AOwner: TComponent; AParentHandle:integer; const AObjectInf:Variant);
end;
implementation
{$R *.dfm}
{ TFrmTest }
constructor TFrmTest.Create2(AOwner: TComponent; AParentHandle: integer; const AObjectInf: Variant);
begin
inherited Create(AOwner);
XObjIntf:= AObjectInf;
ACustumerObj:= XObjIntf.CreateObj('CUSTOMER');
ACustTable:= ACustumerObj.FindTable('CUSTOMER');
end;
procedure TFrmTest.Button1Click(Sender: TObject);
begin
ACustumerObj.DBInsert;
ACustTable.Edit;
ACustTable.code:= Edit1.Text;
ACustTable.name := Edit2.Text;
ACustumerObj.DBPost;
ShowMessage('Customer data posted!');
ACustumerObj.PRINTFORM(2, 'Microsoft Office Document Image Writer', '');
end;
procedure TFrmTest.WMDestroy(var Message: TMessage);
begin
ShowMessage('Form Destroy!');
end;
procedure TFrmTest.Button3Click(Sender: TObject);
begin
XObjIntf.EXCEPTION('JohnG');
end;
end.