|
-
Mar 30th, 2002, 12:52 AM
#1
Threading help
i have the following code which I am having trouble with.
what I need to do is pass viriables to the function the thread will be executing
here's what I have so far
Public Function startdlthread(ByRef url As String, ByRef LocalFilename As String, ByRef filecount As Short)
dlthread = New System.Threading.Thread(AddressOf DownloadFile(url, LocalFilename, filecount))
dlthread.Start()
End Function
this is the what i get for an error
AddressOf operand must be the name of a method; no parentheses are needed.
what am i missing here ?
-
Mar 30th, 2002, 07:08 AM
#2
Lively Member
You can't pass any parameters to a method call when explicitally executing it on a new thread.
If you really need the create a new thread explicitally you could pass the parameters in the constructor.
If you don't need to explicitally create the new thread, you could use for example an async delegate, which does support passing parameters.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|