473,387 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

"Error creating window handle." Exception

Hi All,
Sometimes my application crashes with the exception

Exception type: System.ComponentModel.Win32Exception
Message: Error creating window handle.

My Question to you guys are:
1. I am not able to find out the root cause of it. Can somebody help me out?
2. How can I find the total window handle count?
If I open crash dump and run the command !handle, it provides me 792 handle count. Further investigation (!DumpHeap -type System.Windows.Forms.NativeWindow and !DumpArray -details <address>) says there is a generation 3 System.Windows.Forms.NativeWindow class which is having 8419 HandleBuckets (System.Windows.Forms.NativeWindow+HandleBucket). If I add both of them, still they are lesser than 10k limit of handles.

Can some body gives any clue? Am I missing something to find out handle count?
I am using .NET 2.0 + C# and can not provide source of my application. This error does not happen every time and seems non replicable.

Thanks in Advance.
Feb 19 '09 #1
2 9076
vekipeki
229 Expert 100+
Are you using some P/Invoke Win32 methods to create handles yourself?

I remember I once had this error, when I made an override of CreateParams property, but it only occured in Win2k; while it worked fine in Xp and Vista.

Do you have the exception's stack trace to try to see where it happens?
Feb 19 '09 #2
Thanks for the reply,

The applicaition has used unmanaged code a lot (C/C++ --> Managed C++ --> C#). however, as far as UI part is concerned, it is largely in mananged code.
The application fails inside System.Windows.Forms.dll while doing some of the most stupid tasks, like
in "System.Windows.Forms.Timer.Start"
in "Controls.Visible = True"

I am uanble to find out exact handle count in my crash dump. Also not able to track those handles.
This is the stack trace from crash dump:

System_Windows_Forms_ni!System.Windows.Forms.Nativ eWindow.CreateHandle(System.Windows.Forms.CreatePa rams)
System_Windows_Forms_ni!System.Windows.Forms.Timer +TimerNativeWindow.EnsureHandle()
System_Windows_Forms_ni!System.Windows.Forms.Timer +TimerNativeWindow.StartTimer(Int32)
System_Windows_Forms_ni!System.Windows.Forms.Timer .set_Enabled(Boolean)
System_Windows_Forms_ni!System.Windows.Forms.Timer .Start()
Syncfusion_Shared_Base!Syncfusion.Windows.Forms.Mo useControllerDispatcher.ProcessMouseMove(System.Wi ndows.Forms.MouseEventArgs)
Syncfusion_Shared_Base!Syncfusion.Windows.Forms.Sc rollControllMouseControllerDispatcher.ScrollContro lMouseMoveHandled(System.Object, System.Windows.Forms.MouseEventArgs)
Syncfusion_Shared_Base!Syncfusion.Windows.Forms.Sc rollControl.OnScrollControlHandledMouseMove(System .Windows.Forms.MouseEventArgs)
Syncfusion_Shared_Base!Syncfusion.Windows.Forms.Sc rollControl.OnMouseMove(System.Windows.Forms.Mouse EventArgs)
Syncfusion_Grid_Windows!Syncfusion.Windows.Forms.G rid.GridControlBase.OnMouseMove(System.Windows.For ms.MouseEventArgs)
Syncfusion_Grid_Windows!Syncfusion.Windows.Forms.G rid.GridControlBaseImp.OnMouseMove(System.Windows. Forms.MouseEventArgs)
System_Windows_Forms_ni!System.Windows.Forms.Contr ol.WmMouseMove(System.Windows.Forms.Message ByRef)
System_Windows_Forms_ni!System.Windows.Forms.Contr ol.WndProc(System.Windows.Forms.Message ByRef)
Syncfusion_Shared_Base!Syncfusion.Windows.Forms.Sc rollControl.WndProc(System.Windows.Forms.Message ByRef)
Syncfusion_Grid_Windows!Syncfusion.Windows.Forms.G rid.GridControlBase.WndProc(System.Windows.Forms.M essage ByRef)
System_Windows_Forms_ni!System.Windows.Forms.Contr ol+ControlNativeWindow.OnMessage(System.Windows.Fo rms.Message ByRef)
System_Windows_Forms_ni!System.Windows.Forms.Contr ol+ControlNativeWindow.WndProc(System.Windows.Form s.Message ByRef)
System_Windows_Forms_ni!System.Windows.Forms.Nativ eWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)

[SP and IP removed for the sake of clarity]
Feb 19 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: viditm | last post by:
Hi I keep getting the error "Error Creating Windows Handle" in my application and different places in the code. This occurs only to certain users. Its very random and cannot be reproduced in the...
6
by: DraguVaso | last post by:
Hi, In my application, on some given actions while debugging in Visual Studio, I suddenly get a "System.ComponentModel.Win32Exception was unhandled" Message="Error creating window handle."...
6
by: Lauchlan M | last post by:
Hi. Usin ASP.NET, getting an "Object reference not set to an instance of an object" error. In my login.aspx page I have: string arrUserRoles = new string {"UserRole"};...
0
by: Arne Styve | last post by:
Hi, I am developing a small application in C# where I call a C API. This application is to control some videocards from DataPath. After installing the graphichs card and the videoswitch cards...
1
by: Arne | last post by:
Hi, I keep getting "Error creating window handle." now and then while running my C# application. I've tried to figure out why, but I'm stuck. What is the usual cause of this error ? The error...
1
by: John Chorlton | last post by:
I've been attempting to pass a chunk of data back from a child Windows form using public properties on the form and have been getting some odd errors. I wanted to return a row of data to avoid...
1
by: Flack | last post by:
Hey guys, Here is whats happening. I have a StringBuilder, a TextBox, and a TabControl with one TabPage. On my main form, I created and displayed a fairly big maze. While the app is solving...
5
by: Grant Edwards | last post by:
I'm trying to use the py-gnuplot module on windows, and have been unable to get it to work reliably under Win2K and WinXP. By default, it uses popen(gnuplotcmd,'w'), but in some situations that...
0
by: ilangovan | last post by:
Hai friends, I have a problem in my windows application which contains about 11000 lines. For this application, i download the tabcontrols from the net. An error which has the name of...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.