473,406 Members | 2,343 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,406 software developers and data experts.

Threading and AddressOf in VB.Net

Hi, can someone tell me why wont this work:

Dim t1 As New System.Threading.Thread( _
AddressOf reflectionBegin(aString As String))
Referring to 'As' - Compiler says that Comma, ')' or a valid expression
continuation expected.

I am trying to get AddressOf to point to this method:

.....
Public Sub reflectionBegin(ByVal aString As String)
.....

How do i do it? All the examples show methods with no paramaters included.
When i don't include paramaters compiler says signature not the same.

".... Method 'Public Sub reflectionBegin(aString As String)' does not have
the same signature as delegate 'Delegate Sub ThreadStart()'....."

How do I fix it?

thx
Nick.
Jul 21 '05 #1
2 2274
You can't, because your reflectionBegin method does not match the thread
start delegate.

Hit Google and look for "pass value to thread" or some such. You'll find
examples of how to do that.
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"Nick" <ho*********@hotmail.com> wrote in message
news:1y***************@news-server.bigpond.net.au...
Hi, can someone tell me why wont this work:

Dim t1 As New System.Threading.Thread( _
AddressOf reflectionBegin(aString As String))
Referring to 'As' - Compiler says that Comma, ')' or a valid expression
continuation expected.

I am trying to get AddressOf to point to this method:

....
Public Sub reflectionBegin(ByVal aString As String)
....

How do i do it? All the examples show methods with no paramaters included.
When i don't include paramaters compiler says signature not the same.

".... Method 'Public Sub reflectionBegin(aString As String)' does not have
the same signature as delegate 'Delegate Sub ThreadStart()'....."

How do I fix it?

thx
Nick.

Jul 21 '05 #2
You can't, because your reflectionBegin method does not match the thread
start delegate.

Hit Google and look for "pass value to thread" or some such. You'll find
examples of how to do that.
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"Nick" <ho*********@hotmail.com> wrote in message
news:1y***************@news-server.bigpond.net.au...
Hi, can someone tell me why wont this work:

Dim t1 As New System.Threading.Thread( _
AddressOf reflectionBegin(aString As String))
Referring to 'As' - Compiler says that Comma, ')' or a valid expression
continuation expected.

I am trying to get AddressOf to point to this method:

....
Public Sub reflectionBegin(ByVal aString As String)
....

How do i do it? All the examples show methods with no paramaters included.
When i don't include paramaters compiler says signature not the same.

".... Method 'Public Sub reflectionBegin(aString As String)' does not have
the same signature as delegate 'Delegate Sub ThreadStart()'....."

How do I fix it?

thx
Nick.

Jul 21 '05 #3

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

Similar topics

4
by: Charles A. Lackman | last post by:
Hello and thank you for your assistance. I have attempted to accomplish what I need using delegates with no success. i.e. //Button Click// Dim PollThread As Threading.Thread PollThread = New...
2
by: Vjay77 | last post by:
In this code: Private Sub downloadBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) If Not (Me.downloadUrlTextBox.Text = "") Then Me.outputGroupBox.Enabled = True...
0
by: Eric Sabine | last post by:
OK, I'm trying to further my understanding of threading. The code below I wrote as kind of a primer to myself and maybe a template that I could use in the future. What I tried to do was pass data...
17
by: One Handed Man \( OHM - Terry Burns \) | last post by:
Assumes a Form with a Panel on it., Does the Mutex have to be within the address of a thread start address ? Cheers - OHM '----------- *************** ---------------- Private...
0
by: Pawan Narula via DotNetMonster.com | last post by:
hi all, i'm using VB.NET and trying to code for contact management in a tree. all my contacts r saved in a text file and my C dll reads them one by one and sends to VB callback in a sync mode...
13
by: notregister | last post by:
my program have as many as 8 threads running at a same time. can different threads open a same file at the same time? let say thread1 open a file abc.txt at the same time with thread 2, both doing...
2
by: Ramta | last post by:
Hi all, I am trying to develop a Producer thread that listens for UDP packets on a socket and store then in an ArrayList. The consumer should read data from list and block when no element is...
0
by: Colmeister | last post by:
I recently read Jason Clark's excellent article on Unhandled Exceptions (http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx) and have attempted to incorporate the features he talks...
4
by: Phil G. | last post by:
I was recently struggling to adapt an example I have using delegate methods, IasynResult and AsynCallback. Doing a little research I came across an example, which in fact was being used to...
2
by: esource | last post by:
Hi all, I'm trying to use threading model in my web service but addressof does not work with functions I'm using VS 2005 my code: Public Function Start() as Boolean Dim MyThread As New...
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: 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
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.