I just finished reading Inside OLE, and it I gathered from that that
any object should be able to at run time create a sink and attach
it to an event source, of course done with the help of the
IProvideClassInfo.
Errors that I get trying to fiddle with things are like "Object doesn't
support
Automation events." Is it not true that automation is done entirely through
the IDispatch interface and automation events will to( chapter 24). So I may
be confused
but in automation a call to IConnectionPoint will return an IDispatch
pointer
and a string as to which function to call. With VB supposedly only
supporting
automation I think it should be possible to create a IDispatch based sink at
runtime and hook it to whatever object has such an event set. If you have
the time to answer one other question on this line. As I was staring at the
object browser it looked like the event set was the same for all intrinsic
controls.
Is this true?
TIA, Jason
Quote:
>Jason
>IDispatch and dispinterface are the same. VB uses IDispatch for events. You
>cannot add or change events a runtime. This is because you must early bind
>to an object to get what events it has. VB will create an event sink
>through the COM interfaces IConnection Point and IConnectionPointContainer.
>to hook up the client's event sink to the object's outbound interface. We
>do this by looking at the typlib for outbound method calls. Because the
>object is a COM component you should not change the interface once the
>component is published. Also COM components are compiled so if you wanted
>to change the interface you would have to re-compile the object.
>Thanks
>Brian Combs
>Microsoft Developer Support for Visual Basic