By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,160 Members | 1,983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,160 IT Pros & Developers. It's quick & easy.

System.Threading.Thread error.

P: n/a
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
Me.bytesDownloadedTextBox.Text = ""
Me.totalBytesTextBox.Text = ""
Me.progressBar.Minimum = 0
Me.progressBar.Maximum = 0
Me.progressBar.Value = 0
Dim dl As DownloadThread = New DownloadThread
dl.DownloadUrl = Me.downloadUrlTextBox.Text
AddHandler dl.CompleteCallback, AddressOf
DownloadCompleteCallback
AddHandler dl.ProgressCallback, AddressOf
DownloadProgressCallback
Dim t As System.Threading.Thread = New
System.Threading.Thread(New
System.Threading.ThreadStart(dl.Download))
t.Start()
End If

This line:

[code:1:58b099c7e5]
Dim t As System.Threading.Thread = New System.Threading.Thread(New
System.Threading.ThreadStart(dl.Download))
[/code:1:58b099c7e5]

shows underlined as being in error... and I can't figure out what is
wrong with my syntax...

please help

vjay

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
What is the error message?

Just a guess, but "dl.download" should take no parameters. Also you need to
use the "addressof" operator in the constructor of the threadstart like this
(watch out for line breaks):

------------------------
Dim t As System.Threading.Thread = New System.Threading.Thread(New
System.Threading.ThreadStart(addressof dl.Download))
-------------------------------

A shorthand version would be:

------------------------
Dim t As new System.Threading.Thread(addressof dl.Download)
-------------------------------

Hope this helps,

Trev.

"Vjay77" <vj********@hotmail-dot-com.no-spam.invalid> wrote in message
news:3f**********@127.0.0.1...
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
Me.bytesDownloadedTextBox.Text = ""
Me.totalBytesTextBox.Text = ""
Me.progressBar.Minimum = 0
Me.progressBar.Maximum = 0
Me.progressBar.Value = 0
Dim dl As DownloadThread = New DownloadThread
dl.DownloadUrl = Me.downloadUrlTextBox.Text
AddHandler dl.CompleteCallback, AddressOf
DownloadCompleteCallback
AddHandler dl.ProgressCallback, AddressOf
DownloadProgressCallback
Dim t As System.Threading.Thread = New
System.Threading.Thread(New
System.Threading.ThreadStart(dl.Download))
t.Start()
End If

This line:

[code:1:58b099c7e5]
Dim t As System.Threading.Thread = New System.Threading.Thread(New
System.Threading.ThreadStart(dl.Download))
[/code:1:58b099c7e5]

shows underlined as being in error... and I can't figure out what is
wrong with my syntax...

please help

vjay

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---
Nov 20 '05 #2

P: n/a
Absolutely amazing. Thanks a lot for all your help.
Thanks it worked.

vjay

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.