unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ActiveX, P4COM_TLB, Tp4_lib; type TForm1 = class(TForm) ListBox1: TListBox; btnRun: TButton; procedure btnRunClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.btnRunClick(Sender: TObject); var p4: Tp4; info: TstringList; msg: String; i: integer; begin p4 := tp4.Create; p4.Port := '1666'; msg := p4.Port; { MessageBox(0, pansichar(msg), 'p4comtest', MB_OK); } p4.User := 'robert'; p4.Client := 'bruno_ws'; p4.Connect; info := p4.run('info'); for i := 0 to info.Count - 1 do listbox1.Items.add(info[i]); p4.Destroy; end; end.
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 5194 | Robert Cowham |
Changes (2005.1.0.0) Added Dropped() to detect dropped connections Added Input property to provide input e.g. for passwords Added FormatDateTime() as a convenience for calling C Runtime function (for VB use) Imported changes from p4ofc which made it more reliable. |
||
#1 | 4242 | Robert Cowham |
Fixed some String leaks. Fixed problem with writing to temporary files. Updated p4API to released version of 2003.2. Start of Delphi example. |