I have a COM library written in C++ not VB that exports three COM objects, one of which fires Events. These objects are not controls/components. The (first) question is: How do I catch those event in VB?
I emphasize that they're not controls because I know how to deal with events fired by a control. You put them on a form and the Sub's to capture their events show up automatically in the Form code. But the COM object that fires events doesn't belong on any Form (I don't think) because it has no visible presence and besides, it needs to be global. That is, the VB programmer has to instantiate it exactly once and then get to it from throughout his application.
Second question: The Events fired by the one COM object have parameters that are (arrays of) instances of the other two COM objects. The parameters are defined as VARIANT in the COM event interface. How should they be defined in the VB code? (All the object types are defined in the one type library so the VB code has access to them.) That is, how can the VB programmer treat them as objects of the correct COM type?
PS: I'm the C++ programmer who designed this without much consideration of how to get to it from VB. Since I know almost nothing about VB. Now, I wonder if I've done it all wrong.
I emphasize that they're not controls because I know how to deal with events fired by a control. You put them on a form and the Sub's to capture their events show up automatically in the Form code. But the COM object that fires events doesn't belong on any Form (I don't think) because it has no visible presence and besides, it needs to be global. That is, the VB programmer has to instantiate it exactly once and then get to it from throughout his application.
Second question: The Events fired by the one COM object have parameters that are (arrays of) instances of the other two COM objects. The parameters are defined as VARIANT in the COM event interface. How should they be defined in the VB code? (All the object types are defined in the one type library so the VB code has access to them.) That is, how can the VB programmer treat them as objects of the correct COM type?
PS: I'm the C++ programmer who designed this without much consideration of how to get to it from VB. Since I know almost nothing about VB. Now, I wonder if I've done it all wrong.