System.OutOfMemory exception: error creating window handle
From: Serge Lobko-Lobanovsky (arilou_camper_at_discussions.microsoft.com)
Date: 10/14/04
- Next message: Sriram Krishnan: "Re: Compatibility Issues with .NET Framework"
- Previous message: Sriram Krishnan: "Re: Passing parameters to a thread"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 14 Oct 2004 06:31:07 -0700
Hi,
Software:
.NET 1.1 (both non-SP and SP1)
Visual Studio .NET 2003
MS SQL Server 2000 SP3
Windows XP SP 2
Hardware:
Intel Celeron 1700, Pentium 4 2.4GHz, AMD Athlon 1100
RAM 256-512 DDR
I've run into a strange problem. There is an application which allows to:
1) connect to a certain device using a modem
2) manage different aspects (mostly, working with MS SQL Server)
Serial communication is done on a separate thread, one per each connection.
The maximum number of simultaneous connections is 20.
Note: what is written below applies only when running the application not
under the debugger.
The app starts and works correctly: accepts incoming calls, performs
different scenarios, dials out when necessary. When the comms thread needs to
modify the UI, it is correctly done using Control.BeginInvoke. However,
sometimes (on different computers) the following exception is thrown:
System.OutOfMemory exception: error creating window handle --->
System.NullReferenceException: Object reference not set to an instance of
object.
at System.Windows.Forms.ThreadContext.OnThreadException
at System.Windows.Forms.Control.WndProcException
at System.Windows.Forms.ControlNativeWindow.OnThreadException
at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
at System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(int32, string,
string, int32, int32, int32, int32, int32, HandleRef, HandleRef, HandleRef,
object)
at System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(int32, string,
string, int32, int32, int32, int32, int32, HandleRef, HandleRef, HandleRef,
object)
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams)
-- End of inner exception stack trace --
at System.Windows.Forms.ThreadContext.OnThreadException
at System.Windows.Forms.Control.WndProcException
at System.Windows.Forms.ControlNativeWindow.OnThreadException
at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef, int32)
at System.Windows.Forms.Control.SetVisibleCore
at System.Windows.Forms.Form.SetVisibleCore
at System.Windows.Forms.Control.set_Visible
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog
at <my form-my code to ShowDialog>
What could be the problem?
Let me stress that this does not happen under debuggers. When debugging, the
exception is not thrown. It was noted that this happens more often when
having an active connection.
-- Regards, Serge (Logic Software)
- Next message: Sriram Krishnan: "Re: Compatibility Issues with .NET Framework"
- Previous message: Sriram Krishnan: "Re: Passing parameters to a thread"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|