473,386 Members | 1,715 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,386 software developers and data experts.

Dynamic Discovery of Delegates

Help please, I need a genius!!!

[I'm using VB.NET 2003]

I have an application that loads assemblies at runtime. These assemblies
have many classes (objects) and some do have several delegates. I want to be
able to discover a delegate on an object, and to be able to programmatically
assign it to a callback address.

In my app, I have an object with delegate defined as follows:

public delegate StringChanged(strNewValue as string)
private myStringChangedDelegate as StringChanged

I then have a method to assign a callback to this delegate, such as:

public sub AddListenerToStringChanged(callback as StringChanged)
myStringChangedDelegate = .... ' you know the drill here...
end sub
The thing is, I can (at runtime) detect the above procedure, but I want I
want to do is to programmatically assign a callback address to this...
something along the lines of:

myObject.AddListenerToStringChanged(addressof obj2.StringChangedListener)
I am guessing that I need to use some kind of "MethodInvoke" or something?
but it's the "Addressof" operator that gets me... I just can't find the
information or the syntax that the compiler will accept.

In summary, my question is:
How do I invoke a method which requires an Addressof operator?

Any help would be truly appreciated. Thanks.


Jul 21 '05 #1
0 1328

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

Similar topics

6
by: jason | last post by:
hello everyone, is there any way in C# to perform dynamic property discovery? i know such a thing was possible in C++ template code, but it was kind of an ugly mess. i'm just curious if there is...
0
by: Chris | last post by:
Hi, I have created a vsdisco-file on a webserver (http://MyHost/MyWebServices/test.vsdisco), activated dynamic-discovery by adding an entry in <httpHandlers> in machine.config. But then what...
2
by: Mark Broadbent | last post by:
I had a requirement to code dynamic delegates, so they attach detach from the button as needed ... then after time realised that the button is not retaining it's click handlers. To circumvent this...
15
by: Nak | last post by:
Hi there, Is it possible to load a web service dynamically? i.e. If the web service were to exist on a system with a non static IP address, an application could download a "locator" file that...
1
by: Nate | last post by:
Help please, I need a genius!!! I have an application that loads assemblies at runtime. These assemblies have many classes (objects) and some do have several delegates. I want to be able to...
0
by: Nate | last post by:
Help please, I need a genius!!! I have an application that loads assemblies at runtime. These assemblies have many classes (objects) and some do have several delegates. I want to be able to...
7
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We...
7
by: Chris Mullins | last post by:
I'm in the process of building a number of (Web) Services using .NET 3.0 and WCF. These services are intended to be deployed within the Intranet of a very, very large orginization. I need to...
2
by: HockeyFan | last post by:
I have a web service that has been working, but I recently changed it so that the reference would be dynamic. Locally, within Visual Studio, it works fine. However, once deployed, the dll I use...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
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,...

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.