473,396 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to AddHandler to a late bounded COM Object

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
Nov 20 '05 #1
4 1828
"Captain Chaos" <Ca**********@nospam.com> schrieb

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

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
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.................

"Armin Zingler" <az*******@freenet.de> schrieb im Newsbeitrag
news:uz**************@TK2MSFTNGP12.phx.gbl... "Captain Chaos" <Ca**********@nospam.com> schrieb

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

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
"Captain Chaos" <Ca**********@nospam.com> schrieb
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 )


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.

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4

Ok, you are right, thanx anyway.
"Armin Zingler" <az*******@freenet.de>
news:e1**************@TK2MSFTNGP11.phx.gbl...
"Captain Chaos" <Ca**********@nospam.com>
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 )


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.

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Just Me | last post by:
When a document is to be printed I call a method that contains an AddHandler statement. I just realized that if a second copy is to be printed the method is called and the AddHandler is executed...
10
by: Rick Palmer | last post by:
I have an app I'm working on that will allow a user to run one of 5 reports. The report names are in a combobox on my form. I have a sub defined for each report that has the exact same name as is...
2
by: Bruno Rodrigues | last post by:
The controls in my form are bounded to a datasource, including textboxes, comboboxes, etc... Something lame happens: In runtime, the last focused control before clicking on my save button, doesn't...
2
by: TrtnJohn | last post by:
If you call AddHandler and hook events of one object to a method in a class will the event source object still be available for garbage collection if the original reference is set to Nothing? Or...
3
by: Joe | last post by:
Hello All: I have coded the following in a webform: Dim btn As New Button btn.ID = "btnDynamicCarbonCopies" btn.Text = " More " AddHandler btn.Click, AddressOf AddDynamicCarbonCopy
4
by: Andrew Wilkie | last post by:
I have written code to create a menu on a VB form from a database table. This all works fine. But what I need to do is associate the Handler procedure for the click event of each menu. Each item...
5
by: Slim | last post by:
i have a simple page, with one button button1. when click it creates a new button button 2 and adds a event handler to it. but when button 2 is clicked nothing happens, why? Partial Class...
4
by: qasd3 | last post by:
Hi, I just have a problem that I can not workout a solution to. I have a gridview which gets a bunch of controls created dynamically. What I want to be able to do is have one dropdownlist...
4
chathura86
by: chathura86 | last post by:
Hi i have bounded a dataset to a listbox and i want to get the selected values when i clicked add and write them to a text box. here is the code i'v used Imports System.Data.SqlClient Public...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.