473,379 Members | 1,245 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,379 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 1326

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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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...

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.