home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
MYAUTO.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-28
|
2KB
|
63 lines
//----------------------------------------------------------------------------
//Borland C++Builder
//Copyright (c) 1987, 1997 Borland International Inc. All Rights Reserved.
//----------------------------------------------------------------------------
/*
This object has one method and one property that are available via OLE
automation. The property allows you to set the value of a string, and
the method shows the string in a dialog.
For this example to work, you need to run the TestAp program, stored in this
same directory. Before running TestAp, you should run this program once,
passing in /regserver as the program's sole parameter.
Open up the DPR file to see the call to Automation.ServerRegistration. }
*/
int Initialization();
static int Initializer = Initialization();
#undef RegisterClass
#include "myauto.h"
#include <Dialogs.hpp>
__fastcall TMyAuto::TMyAuto() : TAutoObject(){
}
void __fastcall TMyAuto::ShowDialog(){
if (FMyProp == ""){
FMyProp = "This object has a property called MyProp";
ShowMessage(FMyProp);
}
}
void __fastcall TMyAuto::SetMyProp(AnsiString S){
ShowMessage("In SetMyProp()");
ShowMessage(S);
FMyProp = S;
}
AnsiString __fastcall TMyAuto::GetMyProp(){
ShowMessage("In GetMyProp()");
return FMyProp;
}
void RegisterMyAuto(){
TAutoClassInfo AutoClassInfo;
AutoClassInfo.AutoClass = __classid(TMyAuto);
AutoClassInfo.ProgID = "AUTOPROJ.MyAuto";
AutoClassInfo.ClassID = "{FE67CF61-2EDD-11CF-B536-0080C72EFD43}";
AutoClassInfo.Description = "Sam";
AutoClassInfo.Instancing = acMultiInstance;
Automation->RegisterClass(AutoClassInfo);
}
int Initialization(){
RegisterMyAuto();
return 0;
}