ActiveForm: exposing properties


2005-03-16 05:03:09 AM
cppbuilder91
I'm looking for basic information on how to create a property in an
active form and then expose it so that it can be manipulated by the
client application of the ActiveForm. I've looked at loads of sources
and not
one seems to give a basic introduction as to how the following can be
achieved:
I've created an ActiveForm project, and created a new property called
NewProperty in the type library and written the code for the
set_NewProperty and get_NewProperty functions. As a result, I have the
declarations in the ActiveFormImpl1.h file:
STDMETHOD(get_NewProperty(BSTR* Value));
STDMETHOD(set_NewProperty(BSTR Value));
So in my host application, I have placed the ActiveForm on the main
form
with an edit box, and would like to set this NewProperty with
something
like:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
ActiveFormX1->NewProperty = Edit1->Text;
}
But when I compile, I get the following error:
'NewProperty' is not a member of 'TActiveFormX'
This is true, but then neither are AxBorderStyle, etc. What do I have
to do next to expose these functions to allow the host to access them?
Thanks in advance,
JF