Click here to Skip to main content
15,918,109 members
Home / Discussions / COM
   

COM

 
GeneralRe: Help please ...COM client Pin
Omar Alvi9-Jan-04 10:47
Omar Alvi9-Jan-04 10:47 
GeneralRe: Help please ...COM client Pin
Jörgen Sigvardsson9-Jan-04 11:14
Jörgen Sigvardsson9-Jan-04 11:14 
GeneralRe: Help please ...COM client Pin
Jörgen Sigvardsson9-Jan-04 11:13
Jörgen Sigvardsson9-Jan-04 11:13 
GeneralDCOM Pin
rajusnair9-Jan-04 4:50
rajusnair9-Jan-04 4:50 
GeneralMemory Leakage. Pin
JigarThakkar8-Jan-04 22:49
JigarThakkar8-Jan-04 22:49 
GeneralRe: Memory Leakage. Pin
Jörgen Sigvardsson9-Jan-04 9:41
Jörgen Sigvardsson9-Jan-04 9:41 
GeneralCOM client in VB Pin
Member 8040808-Jan-04 18:24
Member 8040808-Jan-04 18:24 
GeneralRe: COM client in VB Pin
Jörgen Sigvardsson9-Jan-04 9:50
Jörgen Sigvardsson9-Jan-04 9:50 
You need to implement a source interface in your COM object via IConnectionPointContainer. The ATL wizard will do this for you. I can't remember how it works in VC6, but in VS.NET, you can check "Connection Points" on the "Options" page of the wizard.

The wizard will give you an interface IYourInterface. This is the interface you specified for your object. It will also give you a dispinterface called _IYourInterfaceEvents. This is the source interface which VB will recognize with WithEvents.

Just add your event functions in that interface. Then when you are done (or whenever you modify this interface), right click on your COM class in the Class View, and select "Add -> Add Connection Point". The IDE will now generate (or update if you've done this before) the proxy class for firing the events (resides in the file _IYourInterfaceEvents_CP.h). This template class is inherited by your COM class (the wizard set this up, you don't have to do it manually). It provides Fire_XXX-functions for you to use within the methods of your COM class. If you have defined an event like this: void OnEvent(long x, BSTR y), the corresponding firing function will look like this: Fire_OnEvent(long x, long y). If you call such a fire function, the proxy class will automatically call all event sinks with the parameters you provided.

Was this what you needed to know?

--
If there was a problem, Yo, I'll solve it!
Check out the hook while my DJ revolves it.

QuestionC++ unable to access COM object, but VB can? Pin
Nathan Brown8-Jan-04 11:27
Nathan Brown8-Jan-04 11:27 
AnswerRe: C++ unable to access COM object, but VB can? Pin
Vi28-Jan-04 21:24
Vi28-Jan-04 21:24 
GeneralRe: C++ unable to access COM object, but VB can? Pin
Nathan Brown9-Jan-04 13:12
Nathan Brown9-Jan-04 13:12 
GeneralRe: C++ unable to access COM object, but VB can? Pin
Vi211-Jan-04 21:02
Vi211-Jan-04 21:02 
GeneralRe: C++ unable to access COM object, but VB can? Pin
Nathan Brown27-Jan-04 13:37
Nathan Brown27-Jan-04 13:37 
AnswerRe: C++ unable to access COM object, but VB can? Pin
Jörgen Sigvardsson9-Jan-04 9:57
Jörgen Sigvardsson9-Jan-04 9:57 
GeneralRe: C++ unable to access COM object, but VB can? Pin
Nathan Brown9-Jan-04 13:22
Nathan Brown9-Jan-04 13:22 
GeneralRe: C++ unable to access COM object, but VB can? Pin
Jörgen Sigvardsson9-Jan-04 13:34
Jörgen Sigvardsson9-Jan-04 13:34 
QuestionHow to bypass login window? Pin
SiddharthAtw7-Jan-04 18:23
SiddharthAtw7-Jan-04 18:23 
GeneralA property of a user defined ATL class Pin
Gush6-Jan-04 12:23
Gush6-Jan-04 12:23 
QuestionHow to use IWMPPluginUI::TranslateAccelerator? Pin
IGx896-Jan-04 5:07
IGx896-Jan-04 5:07 
GeneralTutorial on COM Pin
Omar Alvi5-Jan-04 4:45
Omar Alvi5-Jan-04 4:45 
GeneralRe: Tutorial on COM Pin
valikac5-Jan-04 4:59
valikac5-Jan-04 4:59 
GeneralCOM & VB.NET overloading Pin
izotov5-Jan-04 2:36
izotov5-Jan-04 2:36 
GeneralRe: COM & VB.NET overloading Pin
Heath Stewart5-Jan-04 13:41
protectorHeath Stewart5-Jan-04 13:41 
GeneralRe: COM & VB.NET overloading Pin
Jörgen Sigvardsson6-Jan-04 6:12
Jörgen Sigvardsson6-Jan-04 6:12 
GeneralRe: COM & VB.NET overloading Pin
Niels Penneman12-Jan-04 10:21
Niels Penneman12-Jan-04 10:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.