How to AddHandler to a late bounded COM Object

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
 
A

Armin Zingler

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

Captain Chaos

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

Armin Zingler

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top