473,396 Members | 1,982 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,396 software developers and data experts.

How to pass parameters to AddressOf for thread?

I'm creating a second thread from my main form like this:

Public t As System.Threading.Thread = New System.Threading.Thread(New
System.Threading.ThreadStart(AddressOf _
SynchItObj.ExportAccessToText(CSVFilePath, CSVFileName,
DatabaseFileName)))

It give this error:
'AddressOf' operand must be the name of a method; no parentheses are
needed.

I need to pass in the above file paths and names. These are set in the main
form and then passed to the class, which is running on the above created
thread. How can I do this?

Thanks,
Brett
Nov 21 '05 #1
2 5375
"Brett" <no@spam.com> schrieb:
I'm creating a second thread from my main form like this:

Public t As System.Threading.Thread = New System.Threading.Thread(New
System.Threading.ThreadStart(AddressOf _
SynchItObj.ExportAccessToText(CSVFilePath, CSVFileName,
DatabaseFileName)))

It give this error:
'AddressOf' operand must be the name of a method; no parentheses are >
needed.


<URL:http://www.google.de/groups?selm=%23mGf7SV%23CHA.2044%40TK2MSFTNGP10.ph x.gbl>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:OI**************@TK2MSFTNGP14.phx.gbl...
"Brett" <no@spam.com> schrieb:
I'm creating a second thread from my main form like this:

Public t As System.Threading.Thread = New System.Threading.Thread(New
System.Threading.ThreadStart(AddressOf _
SynchItObj.ExportAccessToText(CSVFilePath, CSVFileName,
DatabaseFileName)))

It give this error:
'AddressOf' operand must be the name of a method; no parentheses are >
needed.


<URL:http://www.google.de/groups?selm=%23mGf7SV%23CHA.2044%40TK2MSFTNGP10.ph x.gbl>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Good link. Can you explain a little of what they are doing there?

Thanks,
Brett
Nov 21 '05 #3

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

Similar topics

0
by: Radha | last post by:
Hi all, I defined a timer as Friend t_Timer As System.Timers.Timer t_Timer = New System.Timers.Timer() t_Timer.Enabled = True t_Timer.Interval = 10000 AddHandler t_Timer.Elapsed, AddressOf...
1
by: Sivaraman.S | last post by:
Hi, I have thread declared in this way. Dim t As New Thread(AddressOf ThreadProc). Here ThreadProc is a function with two parameters. But i am not able to use function name with addressof, It...
5
by: Mike Hoff | last post by:
Hello, I am wondering if it is possible to pass a procedure name to another proc. I have been looking into delegates, but cannot seem to get the code correct. Basically what I have is a proc to...
3
by: Amjad | last post by:
Hi, To start a new thread of a sub routine I use: '/////////// Dim t as Thread = New Thread (AddressOf MySub) t.Start '\\\\\\\\\\\ How do I start a thread of a sub routine that takes...
17
by: J.S. | last post by:
I have a text file with parameters like the following embedded in the text: @@TextBox1@@, @@TextBox2@@, etc. I know how to read this text file. However, I am trying to figure out how 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...
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...
6
by: =?Utf-8?B?emlubw==?= | last post by:
I'm trying to pass a delegate as parameter but the code below does not compile. It display an error: 'AddressOf operand must the name of a method(without parantheses)' How can I make it work. ...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
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:
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: 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...
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
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...

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.