473,395 Members | 1,458 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,395 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 1178
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...
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: 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...
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
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.