473,379 Members | 1,520 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.

Using Delegates (More Info)

I forgot to capitalize the line causing the error. It is:

printer.PrintCallback(10)
Jul 21 '05 #1
3 1177
now it makes a little more sense although i still think your approach is
wrong (improper use of delegates)

try this on the problem line:
printer.PrintCallback.Invoke(10)

Billy Jacobs wrote:
I forgot to capitalize the line causing the error. It is:

printer.PrintCallback(10)


Jul 21 '05 #2
now it makes a little more sense although i still think your approach is
wrong (improper use of delegates)

try this:

in your original code replace:
printer.PrintCallback = New PrintCallback
(AddressOf driver.PrintInteger)
printer.PrintCallback(10)

with:
printer.PrintCallback = AddressOf driver.PrintInteger
printer.PrintCallback.invoke(10)

Billy Jacobs wrote:
I forgot to capitalize the line causing the error. It is:

printer.PrintCallback(10)


Jul 21 '05 #3
Hi Billy,

Kairi is correct that you should call the delegate object's Invoke method.
In the meantime, I believe the following MSDN articles are helpful:

HOW TO: Use Single and Multicast Delegates in Visual Basic .NET
http://support.microsoft.com/?id=322188

An Introduction to Delegates
http://msdn.microsoft.com/msdnmag/is...t/default.aspx

Please feel free to let me know if you have any problems or concerns.

Have a nice day! :-)

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #4

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

Similar topics

3
by: Sam | last post by:
I’m just starting to learn delegates. I’m at the very beginning. If I understand correctly, delegates are for when you want to pass a function as a parameter. For example the client provides a...
12
by: VM | last post by:
Hi, In my Win app, I'm using delegates because the process that'll be running is time-consuming and it requires parameters. The only problem I'm having is that the lines following the BeginInvoke...
2
by: rb531 | last post by:
Guys, I am struck up with a dilemma whether to use threading or delgates for asynchronous processing. Can anyone throw some light on this? Please let me know which one is better. Thanks
11
by: Doug Thews | last post by:
I've been working on some samples that use BeginInvoke/EndInvoke. In one example, I call BeginInvoke and pass it an AsyncCallback function pointer. I was messing around with ReaderWriterLocks and...
5
by: cody | last post by:
I have a very funny/strange effect here. if I let the delegate do "return prop.GetGetMethod().Invoke(info.AudioHeader, null);" then I get wrong results, that is, a wrong method is called and I...
4
by: bredal Jensen | last post by:
I'm trying to generate a postback to the server when my radio button is selected. This code MyRadio.Attributes.Add("onclick",__doPosback(info,'')) does generate a javascript error. Info is an...
3
by: Billy Jacobs | last post by:
I forgot to capitalize the line causing the error. It is: printer.PrintCallback(10)
30
by: Burkhard | last post by:
Hi, I am new to C# (with long year experience in C++) and I am a bit confused by the language construct of events. What is it I can do with events that I cannot do with delegates? At the moment...
69
by: raylopez99 | last post by:
They usually don't teach you in most textbooks I've seen that delegates can be used to call class methods from classes that are 'unaware' of the delegate, so long as the class has the same...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: 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
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?
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...

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.