BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: How to set params in ActiveX

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (ActiveX)
View previous topic :: View next topic  
Author Message
Uriah Liggett
Guest





PostPosted: Wed Apr 07, 2004 2:19 pm    Post subject: Re: How to set params in ActiveX Reply with quote



Borland's site explains how to do this in 5 easy steps(I forgot the url
but I saved the information)....


This can be done by adding IPersistPropertyBag support to your
ActiveForm. Normally, you would have to go through and actually
implement the whole interface yourself, but the ATL is nice enough to
provide a default implementation and a couple of handy macros. Here are
the things we need to concern ourselves with:
IPersistPropertyBagImpl -- ATL's default IPersistPropertyBag implementation.
COM_INTERFACE_ENTRY_IMPL -- Tells the compiler that our class implements
a certain interface. PROP_ENTRY -- Tells the compiler about a certain
property of our class.

Adding property support to your ActiveForm (or any ActiveX control in
BCB) is relatively simple. Our test ActiveForm is called AFormTest. The
following additions are necessary (all of the code changes below are in
your **Impl.h file.)

1) Add whatever properties you need in the Type Library Editor.
2) Note each property's DispID (this can be seen in the Attributes page
of the TLE under ID).
3) Change the line:
class ATL_NO_VTABLE TAFormTestImpl:
VCLCONTROL_IMPL(TAFormTestImpl, AFormTest, TAFormTest, IAFormTest,
DIID_IAFormTestEvents)
To this:
class ATL_NO_VTABLE TAFormTestImpl:
VCLCONTROL_IMPL(TAFormTestImpl, AFormTest, TAFormTest, IAFormTest,
DIID_IAFormTestEvents),
public IPersistPropertyBagImpl<TAFormTestImpl>

4) Within the BEGIN..END_COM_MAP macros in your **Impl class, add the
following:
COM_INTERFACE_ENTRY_IMPL(IPersistPropertyBag)
5) Within the BEGIN..END_PROPERTY_MAP macros in your **Impl class, add
the following:
PROP_ENTRY("PropertyName",<dispid>,CLSID_*)
Where PropertyName is the name of your property, dispid is it's
DispID, and CLSID_* is its CLSID.
5) Now implement your class's property getter/setters and it should work
just fine!



jon wrote:
Quote:
I'm making an ActiveX control.
I have looked and looked, but I just
cannot see how you set up the control
so it accepts the <param> values in html.

The 'property page' looks inappropriate
for this purpose. And ActiveX controls I have looked
at with params don't seem to have it, by right
clicking on the control on the html page.





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (ActiveX) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.