How to AddHandler to a late bounded COM Object

  • Thread starter Thread starter Captain Chaos
  • Start date Start date
C

Captain Chaos

Hello

I use GetObject() to get a running Activex/COM Object.

I now want to use the Eventhandlers of the COM Object.

If want to do:

AddHandler ComObject.EventXY, addressof MyEventHandler


How can I do this with a COM Object. (Late Binded)

Thanx
 
Captain Chaos said:
I use GetObject() to get a running Activex/COM Object.

I now want to use the Eventhandlers of the COM Object.

If want to do:

AddHandler ComObject.EventXY, addressof MyEventHandler


How can I do this with a COM Object. (Late Binded)

It is not possible.
 
It is not possible.

Everything can be solved....

For example how I could do it the dirty way:

Using the VBScripting Control.
Createing a COMClass with VB.NET

Creating Code to Handle the Event via VBScript on the Fly. (beause in
VBScript you can handle Events dynamicly )
Adding the ComClass to the ScriptingControl.
Runnig the Code.

If the EVent occurs the Scripting Control Catches it
and sends it to the ComClass which is raising the Event.

That's the dirty solution I allready have.

I am 5000% sure there is an cleaner solution than this.................
 
Captain Chaos said:
Everything can be solved....

For example how I could do it the dirty way:

Using the VBScripting Control.
Createing a COMClass with VB.NET

Creating Code to Handle the Event via VBScript on the Fly. (beause
in VBScript you can handle Events dynamicly )

Maybe, but not in VB.NET.
Adding the ComClass to the ScriptingControl.
Runnig the Code.

If the EVent occurs the Scripting Control Catches it
and sends it to the ComClass which is raising the Event.

That's the dirty solution I allready have.

I am 5000% sure there is an cleaner solution than
this.................

Your question was how to catch the events in VB.NET, not how to catch them
in VBScript, so I still say it is not possible.
 
Back
Top