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 

How do I add events to an ActiveX?

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





PostPosted: Fri Jan 02, 2004 11:04 pm    Post subject: How do I add events to an ActiveX? Reply with quote



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





PostPosted: Sat Jan 03, 2004 12:10 am    Post subject: Re: How do I add events to an ActiveX? Reply with quote




"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





PostPosted: Wed Feb 11, 2004 4:55 pm    Post subject: Re: How do I add events to an ActiveX? Reply with quote



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
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.