home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
MAINTEST.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-28
|
2KB
|
42 lines
//----------------------------------------------------------------------------
//Borland C++Builder
//Copyright (c) 1987, 1997 Borland International Inc. All Rights Reserved.
//----------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "maintest.h"
#include <OleAuto.hpp>
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::bRunAutoClick(TObject *Sender)
{
Variant V;
try{
V = CreateOleObject("AutoProj.MyAuto");
V.OleProcedure("ShowDialog");
V.OlePropertySet("MyProp",
"This string was passed to the MyProp "
"property of AutoProj by TestAp");
V.OleProcedure("ShowDialog");
}
catch(EOleSysError& e){
char buf[256];
sprintf(buf, "%s.\n\n%s", e.Message.c_str(),
"Make sure you compile AutoProj first and run it either from\n"
"the commmand line with the /regserver switch or from C++Builder\n"
"after you set the Run|Parameters dialog to /regserver.");
ShowMessage(buf);
}
}
//---------------------------------------------------------------------