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

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 2225
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Dan | last post by:
I've created a pocketpc app which has a startup form containing a listview. The form creates an object which in turn creates a System.Threading.Timer. It keeps track of the Timer state using a...
1
by: solex | last post by:
Hello All, Hopefully someone has run into this error. I have written a class(source below) that launches a thread to monitor the StandardOutput of a System.Diagnostics.Process, in particular I...
2
by: Stressed Out Developer | last post by:
We have an application that has a 200 count loop that does the following: ' Each time thru the loop we pass the next IP Address is a range (aka 192.168.4.50 thru 192.168.4.254) Try If...
5
by: Philip Wagenaar | last post by:
I have a Windows Form application that monitors a directory using the System.IO.FileSystemWatcher. On the event created I run a sub that sends an xml file over http to a service. When I copy...
2
by: clevrmnkey | last post by:
I've had nothing but trouble from the System.Net.Mail objects, but I finally need to make them work, and I can't for the life of me see what I'm doing wrong. I pared back my mail transaction to...
1
by: Pooh | last post by:
hi all, i faced an error in my project: "An unhandled exception of type 'System.Threading.ThreadStateException' occurred in system.windows.forms.dll Additional information: Could not instantiate...
2
by: koredump | last post by:
Hi all, I have a windows app that makes some asyc calls to my webservice (WSE 3.0 with MTOM). exception gets thrown in the client win app. This exception is being thrown on another thread by a...
2
by: PimpDaddy | last post by:
Here is the source code of my C++/ME app. When I run it I can use "Windows Task Manager" to see that thread HANDLEs are leaking. #include "stdafx.h" #include <omp.h> public __gc class...
16
by: Paul Schwann | last post by:
Hi group, I am relatively new to C# (although I have a lot of programming excperience in other languages like Java and C). Currently I am searching for a solution to this problem: Suppose you...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.