home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1996 August
/
VPR9608A.BIN
/
del20try
/
install
/
data.z
/
MAINTEST.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-05-08
|
1KB
|
52 lines
unit MainTest;
{ This is the client half of a 'simplest possible case' Delphi Automation
example. Before this program will work correctly, you need to compile and run
the AutoProj example program. When you run AutoProj, pass in /regserver as a
parameter using the Run|Parameters dialog. }
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
bRunAuto: TButton;
procedure bRunAutoClick(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
uses
OleAuto;
procedure TForm1.bRunAutoClick(Sender: TObject);
var
V: Variant;
begin
try
V := CreateOleObject('AutoProj.MyAuto');
V.ShowDialog;
V.MyProp := 'This string was passed to the MyProp property ' +
'of AutoProj by TestAp';
V.ShowDialog;
except
on E: Exception do
begin
Application.HandleException(E);
ShowMessage('Make sure you compile AutoProj first and run it either ' +
'from the commmand line with the /regserver switch or from ' +
'Delphi after you set the Run|Parameters dialog to /regserver');
end;
end;
end;
end.