C++Builder


- , . , , , , . .

- TEdit, TCheckBox, TOpenDialog, TSaveDialog, .

wpe7.jpg (23966 bytes)

, ( h- ComObj):

//#include <vcl.h>

#pragma hdrstop

#include <ComObj.hpp>

#include autocon.h

//#pragma package(smart_init)

#pragma resource *.dfm

TForm2 *Form2;

Variant Serv;

//__fastcall TForm2::TForm2(TComponent* Owner)

: TForm(Owner)

{

}

//

void __fastcall TForm2::Button3Click(TObject *Sender)

{

Serv=CreateOleObject(Project1.MyAuto3);

}

//

void __fastcall TForm2::Button1Click(TObject *Sender)

{

if (VarType(Serv)==varDispatch) Edit1->Text=IntToStr(Serv.OlePropertyGet(Width));

// ,

//

}

//

void __fastcall TForm2::Button2Click(TObject *Sender)

{

if (VarType(Serv)==varDispatch) Serv.OlePropertySet(Width,StrToInt(Edit1->Text));

}

//

void __fastcall TForm2::Button12Click(TObject *Sender)

{

if (VarType(Serv)==varDispatch) CheckBox1->Checked=Serv.OlePropertyGet(Visible);

}

//

void __fastcall TForm2::Button13Click(TObject *Sender)

{

if (VarType(Serv)==varDispatch) Serv.OlePropertySet(Visible,CheckBox1->Checked);

}