473,320 Members | 1,883 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,320 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 2273
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.