469,592 Members | 1,698 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

System.Threading.Thread error.

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
2 2094
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
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.

Similar topics

1 post views Thread by solex | last post: by
2 posts views Thread by Stressed Out Developer | last post: by
2 posts views Thread by koredump | last post: by
16 posts views Thread by Paul Schwann | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.