Click here to Skip to main content
15,901,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: Read and write to a file! Pin
Heath Stewart15-Oct-04 6:21
protectorHeath Stewart15-Oct-04 6:21 
GeneralRe: Read and write to a file! Pin
leppie14-Oct-04 8:49
leppie14-Oct-04 8:49 
GeneralRe: Read and write to a file! Pin
Heath Stewart14-Oct-04 8:58
protectorHeath Stewart14-Oct-04 8:58 
GeneralRe: Read and write to a file! Pin
ee9903515-Oct-04 1:59
ee9903515-Oct-04 1:59 
GeneralInvoking Secure Web Services Pin
David Salter14-Oct-04 3:53
David Salter14-Oct-04 3:53 
GeneralRe: Invoking Secure Web Services Pin
Heath Stewart14-Oct-04 10:13
protectorHeath Stewart14-Oct-04 10:13 
Generalpropertygrid Pin
AlanJones14-Oct-04 3:43
AlanJones14-Oct-04 3:43 
GeneralSystem.OutOfMemory exception: error creating window handle Pin
Serge Lobko-Lobanovsky14-Oct-04 3:33
Serge Lobko-Lobanovsky14-Oct-04 3:33 
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, Easy Projects .NET site)
GeneralRe: System.OutOfMemory exception: error creating window handle Pin
Heath Stewart14-Oct-04 9:55
protectorHeath Stewart14-Oct-04 9:55 
GeneralRe: System.OutOfMemory exception: error creating window handle Pin
Serge Lobko-Lobanovsky14-Oct-04 21:56
Serge Lobko-Lobanovsky14-Oct-04 21:56 
GeneralRe: System.OutOfMemory exception: error creating window handle Pin
Serge Lobko-Lobanovsky26-Oct-04 6:14
Serge Lobko-Lobanovsky26-Oct-04 6:14 
GeneralRe: System.OutOfMemory exception: error creating window handle Pin
ave\kevinchen3-May-09 23:27
ave\kevinchen3-May-09 23:27 
GeneralFilling a closed contour in a given bitmap Pin
E6AD14-Oct-04 2:52
E6AD14-Oct-04 2:52 
GeneralRe: Filling a closed contour in a given bitmap Pin
Gary Thom14-Oct-04 3:16
Gary Thom14-Oct-04 3:16 
GeneralAutomatic printing to pdf Pin
sverre.andersen14-Oct-04 0:54
sverre.andersen14-Oct-04 0:54 
GeneralRe: Automatic printing to pdf Pin
Gary Thom14-Oct-04 3:17
Gary Thom14-Oct-04 3:17 
GeneralRe: Automatic printing to pdf Pin
Heath Stewart14-Oct-04 7:11
protectorHeath Stewart14-Oct-04 7:11 
GeneralRe: Automatic printing to pdf Pin
Gary Thom14-Oct-04 7:40
Gary Thom14-Oct-04 7:40 
GeneralRe: Automatic printing to pdf Pin
Heath Stewart14-Oct-04 12:18
protectorHeath Stewart14-Oct-04 12:18 
GeneralRe: Automatic printing to pdf Pin
Gary Thom15-Oct-04 8:21
Gary Thom15-Oct-04 8:21 
GeneralRe: Automatic printing to pdf Pin
Heath Stewart15-Oct-04 9:03
protectorHeath Stewart15-Oct-04 9:03 
GeneralRe: Automatic printing to pdf Pin
Heath Stewart14-Oct-04 7:00
protectorHeath Stewart14-Oct-04 7:00 
GeneralRe: Automatic printing to pdf Pin
sverre.andersen19-Oct-04 3:01
sverre.andersen19-Oct-04 3:01 
GeneralRe: Automatic printing to pdf Pin
Heath Stewart19-Oct-04 5:22
protectorHeath Stewart19-Oct-04 5:22 
GeneralRe: Automatic printing to pdf Pin
sverre.andersen19-Oct-04 10:28
sverre.andersen19-Oct-04 10:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.