 |
| Windows Forms Topics include: windows forms, controls, components and designers |
 |

07-17-2003, 04:18 PM
|
|
Newcomer
|
|
Join Date: Jul 2003
Posts: 3
|
|
Thread being stopped against my will.
|
|
Has anyone encountered an unhandled exception being thrown while stepping through the debugger? When this happends I am inside a newly created thread and the function I am in is the one pointed at by the addressof(myThread = New System.Threading.Thread(AddressOf postdata). In this case I am in postdata.
The message I am receiving while stepping through the debugger is:
"An unhandled exception of type 'System.Threading.ThreadStopException' occured in CreditBureauHTTPS.exe
Additional Information: Thread was being stopped."
I have executed the same code with no problems on two separate machines that are identical to the one I am using. One of the machines has the same version of the IDE and Framework.
I am running Visual Studio 2003 with Framework 1.1.
At one point in time, I was able to use the debugger to step through.
I have since uninstalled and reinstalled the IDE. No luck.
Any help is greatly appreciated.
Thanks in advance
|
|

07-18-2003, 09:41 AM
|
|
Newcomer
|
|
Join Date: Jul 2003
Posts: 3
|
|
Oddly enough, the error message has disappeared. I do not know why. What a pain. This went on for a couple of days.
|
|

07-19-2003, 12:11 PM
|
|
Newcomer
|
|
Join Date: Jul 2003
Posts: 3
|
|
|
|
It's back. Help! I was stepping through the code after working for several hours and it just started throwing the exception again. Anyone know how to trap why the thread is being stopped? I believe I have try catches where I need them, so I do not see how I could programmatically catch it.
|
|

07-19-2003, 03:55 PM
|
|
Neutiquam Erro
Preferred language: C# and VB.NET
|
|
Join Date: Nov 2002
Posts: 2,171
|
|
Is it crashing at the same point every time? Do you have some sort of anti-virus program or something that could be attempting to stop your program's thread (unlikely...).
|
|

10-09-2003, 02:19 PM
|
|
Newcomer
|
|
Join Date: Oct 2003
Posts: 1
|
|
Just to let you know I just got this problem now too; It just came out of the blue. (I've never had this problem before)
I'm using VS.NET 2003 (Architect) with .NET Framework 1.1 as well...
I'll keep you posted if I find a solution...
Max
|
|

10-11-2003, 05:19 PM
|
|
Freshman
|
|
Join Date: Aug 2003
Posts: 28
|
|
Anyone figure out what this issue is? I have the same problem.
|
|

10-11-2003, 05:27 PM
|
 |
Guest
Preferred language: VB.net & C#
|
|
Join Date: Jul 2003
Location: Portugal
Posts: 931
|
|
What about VolteFace asked?
Do u have any AV or FireWall active?
Did you made you thread safe?
|
|

10-11-2003, 05:37 PM
|
|
Neutiquam Erro
Preferred language: C# and VB.NET
|
|
Join Date: Nov 2002
Posts: 2,171
|
|
This is weird... I can't find any info on ThreadStopException in my MSDN, and Google turns up only 15 pages about it, one of them being this thread.
Are you using any third party DLLs or anything?
|
|

10-12-2003, 01:48 AM
|
 |
Guest
Preferred language: VB.net & C#
|
|
Join Date: Jul 2003
Location: Portugal
Posts: 931
|
|
Maybe de project or some code would help...
|
|

10-12-2003, 07:34 AM
|
|
Freshman
|
|
Join Date: Aug 2003
Posts: 28
|
|
In form load
testthread = New Thread(AddressOf test)
testthread.Name = "test"
testthread.Start()
Private Sub test()
Dim a As String = "wrew"
Me.Text = "Test" 'crashes here
TextBox1.Text = "test"
Debug.WriteLine("test")
End Sub
This code works fine on my other PC and timers work fine.
|
|

10-12-2003, 08:52 AM
|
 |
Ultimate Contributor
Preferred language: C#, VB
|
|
Join Date: Sep 2002
Location: Lancashire, UK
Posts: 6,346
|
|
Is the sub attempting to update the UI? If so that is probably the problem. UI elements should only be modified from the forms main thread. Search these forums for some examples on using Form.Invoke - not near VS at the moment so I can't dig up the help.
|
|

10-12-2003, 09:34 AM
|
|
Freshman
|
|
Join Date: Aug 2003
Posts: 28
|
|
Yes that's the problem, I just figured it out. It especially comes up if you have a hyperthreaded cpu.
|
|

10-14-2003, 06:17 AM
|
 |
Guest
Preferred language: VB.net & C#
|
|
Join Date: Jul 2003
Location: Portugal
Posts: 931
|
|
I've asked you that before ...
When using threads allways make them ThreadSafe, use delegates for example... specially if the thread modifies th UI...
|
|

02-23-2004, 10:06 AM
|
|
Newcomer
|
|
Join Date: Feb 2004
Posts: 1
|
|
smae prob not modifying ui or using threads
I don't yet know how to use threads in .net so maybe I'm inadvetently doing something with them though I have no code that deals with threads at all.
The class(3) containing the following code is called by a class(2) which is called by the UI form(1), with no attempt to modify or update the UI(1) directly.
class3
................
..
cls4 = New class4(temp, sOutputFile, iPageNo, iSideLength, blChosenSide)
'Thread Was Being Stopped' exception occurs here
cls4.Make()
................
end class
Class(2) however does raise an event that allows the UI(1) to refresh itself.
class2
................
..
Dim cls3 As new class3(sInputFile, sOutputFile)
cls3.Make()
cls3.dispose()
cls3 = Nothing
RaiseEvent done(Me, sOutputFile)' in this event's handler, the UI(1) calls its refresh method
................
end class
(The identifier names have been simplified and much code ommitted for readbility)
The same exception is thrown ad I don't know why.
Please,
help me.
ps I just reallised that the acrobat interop which I'm using may be using threads. Any help with this would be great as I'm not controlling the threading in the COM if it is using it.
Also the word printing system is used prior to this code which may also use threading, D'oh!
Cheers Will
|
Last edited by willg; 02-24-2004 at 04:20 AM.
|

07-30-2004, 06:28 AM
|
|
Newcomer
|
|
Join Date: Jul 2004
Posts: 1
|
|
It might be too late but can help others. One way of overcoming this is to hide your local and auto windows in the IDE. This way I managed to step through in my code in the IDE.
|
|

11-22-2004, 05:48 PM
|
|
Newcomer
|
|
Join Date: Nov 2004
Posts: 1
|
|
Hi everyone,
I had this same error which had me going for about a day. After reading gyurisc's comment about the debugging windows, I cleared all the watches I had going in my window and all of a sudden the error disappeared and my step through performance came back.
Just in case anyone else has this problem, try doing that.
Thanks,
Simon
|
|

10-25-2005, 05:11 AM
|
|
Newcomer
|
|
Join Date: Oct 2005
Posts: 1
|
|
OMG this solved my problem too. What a daft problem it is though!
Thanks all
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
| |
|
|
|
 |
|