Hello,
I have a C# project with windows forms.
I sometimes get unprdictable .NET exceptions. I don't always get them, so I
can't reproduce where exactly it happens. I can generally say it happens when
closing the application (maybe in the dispose method?).
Here are 2 examples:
System.Threadin g.ThreadAbortEx ception: Thread was being aborted.
at System.Windows. Forms.UnsafeNat iveMethods.Call WindowProc(IntP tr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows. Forms.NativeWin dow.DefWndProc( Message& m)
at System.Windows. Forms.Form.DefW ndProc(Message& m)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
at System.Windows. Forms.Container Control.WndProc (Message& m)
at System.Windows. Forms.Form.WndP roc(Message& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
System.Threadin g.ThreadAbortEx ception: Thread was being aborted.
at System.Windows. Forms.UnsafeNat iveMethods.SetF ocus(HandleRef hWnd)
at System.Windows. Forms.Container Control.FocusAc tiveControlInte rnal()
at System.Windows. Forms.Form.set_ Active(Boolean value)
at System.Windows. Forms.Form.WmAc tivate(Message& m)
at System.Windows. Forms.Form.WndP roc(Message& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Any ideas?
thanks,
--
dshemesh
May 28 '07
10 2827
When checking the code more thoroughly It looks something like this:
void Main {
int retval = foo();
if (retval == FAILED) {
System.Environm ent.Exit(-1); }
else {
System.Windows. Forms.Applicati on.Run(new psScheduleTasks ()); }
}
void foo {
Thread a;
a = new Thread(new ThreadStart(Sho wWaitScreen));
a.Start();
more code...
a.abort();
return retval;
}
The exception is thrown when foo returns FAILED.
I tried using System.Windows. Forms.Applicati on.Exit() instead of
System.Environm ent.Exit(-1), but the exception is still begin thrown.
--
dshemesh
"Jorge" wrote:
On May 28, 10:22 am, dshemesh <dshem...@discu ssions.microsof t.com>
wrote:
Hello,
I have a C# project with windows forms.
I sometimes get unprdictable .NET exceptions. I don't always get them, so I
can't reproduce where exactly it happens. I can generally say it happens when
closing the application (maybe in the dispose method?).
Here are 2 examples:
System.Threadin g.ThreadAbortEx ception: Thread was being aborted.
at System.Windows. Forms.UnsafeNat iveMethods.Call WindowProc(IntP tr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows. Forms.NativeWin dow.DefWndProc( Message& m)
at System.Windows. Forms.Form.DefW ndProc(Message& m)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
at System.Windows. Forms.Container Control.WndProc (Message& m)
at System.Windows. Forms.Form.WndP roc(Message& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
System.Threadin g.ThreadAbortEx ception: Thread was being aborted.
at System.Windows. Forms.UnsafeNat iveMethods.SetF ocus(HandleRef hWnd)
at System.Windows. Forms.Container Control.FocusAc tiveControlInte rnal()
at System.Windows. Forms.Form.set_ Active(Boolean value)
at System.Windows. Forms.Form.WmAc tivate(Message& m)
at System.Windows. Forms.Form.WndP roc(Message& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Any ideas?
thanks,
--
dshemesh
Are you spawning threads in your app?
Sometimes it happens when you close an application and some threads
are still running.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Markus Fischer |
last post by:
Hi,
I'm experiencing a wierd problem with IE 6 in Windows with two
_slightly_ different Version.
Give the following HTMl-Code, ideally the output of offsetTop should be
"105"; a few pixel plus minus would still be ok, whyever.
I've tested this successfully on 6.0.2800.1106 on a german W2KPro
machine, also with 6.0.2800.1106 on a german XPPro machine.
|
by: Sathyaish |
last post by:
A practice excercise from K&R. Kindly read the comments within the
program. I'd be very grateful to people who helped. Why is it that I
get the wierd face-like characters on the screen instead of the
boolean output 0s or 1s?
#include <stdio.h>
/*This program is made to check that leaving the brackets around the
epxression (c=getchar()) in
the statement while ((c=getchar()) !=EOF) produces a boolean output in
|
by: Tom |
last post by:
This is very strange: I have a Windows Form with a Panel on it. In that
panel I dynamically (at run time) create some labels, as so:
for i=1 to x
dim ctlNew as New Label()
with ctlNew
.Name="Whatever" & trim(cstr(i))
.Text=.Name
.Visible=True
... etc etc etc ...
|
by: Sašo Zagoranski |
last post by:
Hi...
This is driving me crazy and I really hope I can get an answer...
Take a look at the piece of code below (I'm using .net 2.0):
try
{
double pointTime = XDate.DateTimeToXLDate(point.time);
double pointValue = Convert.ToDouble(point.value);
list.Add(pointTime, pointValue);
|
by: John Nagle |
last post by:
Here's a wierd problem:
I have a little test case for M2Crypto, which just opens up SSL connections to
web servers and reads their certificates. This works fine.
But if I execute
socket.setdefaulttimeout(5.0)
so that the sockets don't wait too long if there's no SSL server, I get
| |
by: desktop |
last post by:
I am confused about the use of the template parameter "E" in the below
class. Since when is it allowed to use these parameters like "E(1)" and
what does it mean (where can I read more about this kind of use)?
template <typename E>
class Mytest {
public:
Mytest(int n) {
s = E(0);
|
by: Bobby Edward |
last post by:
Here's my code...
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not Request.Cookies("UserSettings")("IsAdmin") Is Nothing Then
' THIS IS LINE 11
If Request.Cookies("UserSettings")("IsAdmin") = "True" Then
Me.panAdmin.Visible = True
Else
Me.panAdmin.Visible = False
|
by: Cirene |
last post by:
In my web.config I added <pages enableSessionState="true">.
In each of my pages I also added EnableSessionState="True" to the Page
declaration.
(I didn't think this was necessary, but...)
Any reason why even though I did this I keep getting this error....
Server Error in '/abc' Application.
|
by: alex21 |
last post by:
Ok im getting this exception from a DataGridView control in my program.
System.ArgumentOutOfRangeException was unhandled
Message="Value of '132' is not valid for 'Value'. 'Value' should be between 'minimum' and 'maximum'.\r\nParameter name: Value"
Source="System.Windows.Forms"
ParamName="Value"
StackTrace:
at System.Windows.Forms.ScrollBar.set_Value(Int32 value)
at System.Windows.Forms.DataGridView.ScrollRows(Int32...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |