|
| Random exceptions in Windows Forms app |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on microsoft.public.dotnet.framework.windowsforms.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
| Brian Eng |
| GOOD ANSWER |
We are working on a large project that has several owner-drawn controls and interacts with a couple of COM components (not ActiveX controls). At seemingly random times, we receive (usually) a NullReferenceException. Occasionally, it is a "External component has thrown an exception". Regardless of the type of exception, we get the following stack trace:
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at System.Windows.Forms.Control.DefWndProc(Message& m) at System.Windows.Forms.Control.WmUpdateUIState(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.ParkingWindow.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Our QA team has been unable to find a reproducable path. Any ideas?
|
|
|
| |
|
|
| |
| |
| Sijin Joseph |
| GOOD ANSWER |
Ensure that your windows form App and them COM compoenents are using compatible Threading models. By default all winform apps use the STA threading model. If your COM components are MTA threaded then you could such kind of exceptions.
-- Sijin Joseph http://www.indiangeek.net http://weblogs.asp.net/sjoseph
"Brian Eng" <Click here to reveal e-mail address> wrote in message news:Click here to reveal e-mail address... > We are working on a large project that has several owner-drawn controls and [Original message clipped]
|
|
|
| |
|
|
| |
| |
| Brian Eng |
| GOOD ANSWER |
Thanks for your reply. That is really interesting... Unfortunately, our WinForms app and all COM components are STA. Any other ideas?
"Sijin Joseph" wrote:
[Original message clipped]
|
|
|
| |
|
|
| |
| |
| Brian Eng |
| GOOD ANSWER |
Ok, we are getting to the root of the problem. We are using Spy++ to view the parked window handles that are being created by our application. It seems that when you create a panel that is not initially visible, its child controls are initially parked. When you then close the containing form, those child controls are not properly disposed. Anyone seen this before?
"Brian Eng" wrote:
[Original message clipped]
|
|
|
| |
|
|
| |
| |
| Charles Collins |
| GOOD ANSWER |
I have an application that is throwing the same error, but only when run through terminal server. We have yet to see it in any other instance and it is totally random and sporadic. A solution to this issue would be greatly welcomed here too.
"Brian Eng" <Click here to reveal e-mail address> wrote in message news:Click here to reveal e-mail address... [Original message clipped]
|
|
|
| |
|
|
| |
| |
| Mike Gaffney (VIP) |
I'm also having the same issue: About 600+ users running .NET app. Users connect using Citrix Terminal Services to a WIN 2003 Server. I can't repoduce this on my development PC. This is only reproduced using Terminal Services.
Error: Base Exception Stack Trace: at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at System.Windows.Forms.Control.DefWndProc(Message& m) at System.Windows.Forms.Control.WmUpdateUIState(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.ParkingWindow.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Inner Exceptions (may be empty):
|
|
|
| |
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|