 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Aldo Marchioni Guest
|
Posted: Fri Jan 02, 2004 11:04 pm Post subject: How do I add events to an ActiveX? |
|
|
I have an ActiveX library, written by me with C++ builder.
It works fine, but I need to add events to some of the exposed objects.
I know how to let the wizard take care of that at create time, but I
have no idea how to add event handling to some existing object.
Did anybody do the same? Any hel is appreciated. Thanks.
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Sat Jan 03, 2004 12:10 am Post subject: Re: How do I add events to an ActiveX? |
|
|
"Aldo Marchioni" <aldo_marchioni (AT) iol (DOT) it> wrote
| Quote: | I know how to let the wizard take care of that at create time,
but I have no idea how to add event handling to some existing
object.
|
Create a new DispInterface in the TypeLibrary, add the desired methods to
it, and then add it to the CoClass's "Implements" list. When you refresh
the TypeLibrary, the TLB files will be updated to include the new events
support.
Gambit
|
|
| Back to top |
|
 |
Aldo Marchioni Guest
|
Posted: Wed Feb 11, 2004 4:55 pm Post subject: Re: How do I add events to an ActiveX? |
|
|
Well, had to think about some other stuff for some time ... I'm back on
this now.
I did as you write here below, but my client seems unable to recognize
the new DispInterface, nor I could fire my events.
To be able to call Fire_MyEvent from inside my code, I had to add by
hand a IconnectionPointContainerImpl and a TEvents_xxx<TMyclassImpl> to
the TMyclassImpl declaration. And something more in the COM_MAP, and a
new COMMECTION_POINT_MAP. This I copied from another class declaration,
that was created by the wizard with event support right from the
beginning.
This way, I can compile and link. But when my class is created there is
some mess somewhere, as at the first attempt to create an instance of an
exposed object i get an access violation.
Apparently i miss something, but can't see what right now.
Thanks, Aldo
Remy Lebeau (TeamB) wrote:
| Quote: | "Aldo Marchioni" <aldo_marchioni (AT) iol (DOT) it> wrote in message
news:3ff5f808 (AT) newsgroups (DOT) borland.com...
I know how to let the wizard take care of that at create time,
but I have no idea how to add event handling to some existing
object.
Create a new DispInterface in the TypeLibrary, add the desired methods to
it, and then add it to the CoClass's "Implements" list. When you refresh
the TypeLibrary, the TLB files will be updated to include the new events
support.
Gambit
|
|
|
| Back to top |
|
 |
|
|
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
|
|