473,779 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Error creating window handle." Exception

10 New Member
Hi All,
Sometimes my application crashes with the exception

Exception type: System.Componen tModel.Win32Exc eption
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.NativeWin dow and !DumpArray -details <address>) says there is a generation 3 System.Windows. Forms.NativeWin dow class which is having 8419 HandleBuckets (System.Windows .Forms.NativeWi ndow+HandleBuck et). 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 9127
vekipeki
229 Recognized Expert New Member
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
rvarshney
10 New Member
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.St art"
in "Controls.Visib le = 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. NativeWindow.Cr eateHandle(Syst em.Windows.Form s.CreateParams)
System_Windows_ Forms_ni!System .Windows.Forms. Timer+TimerNati veWindow.Ensure Handle()
System_Windows_ Forms_ni!System .Windows.Forms. Timer+TimerNati veWindow.StartT imer(Int32)
System_Windows_ Forms_ni!System .Windows.Forms. Timer.set_Enabl ed(Boolean)
System_Windows_ Forms_ni!System .Windows.Forms. Timer.Start()
Syncfusion_Shar ed_Base!Syncfus ion.Windows.For ms.MouseControl lerDispatcher.P rocessMouseMove (System.Windows .Forms.MouseEve ntArgs)
Syncfusion_Shar ed_Base!Syncfus ion.Windows.For ms.ScrollContro llMouseControll erDispatcher.Sc rollControlMous eMoveHandled(Sy stem.Object, System.Windows. Forms.MouseEven tArgs)
Syncfusion_Shar ed_Base!Syncfus ion.Windows.For ms.ScrollContro l.OnScrollContr olHandledMouseM ove(System.Wind ows.Forms.Mouse EventArgs)
Syncfusion_Shar ed_Base!Syncfus ion.Windows.For ms.ScrollContro l.OnMouseMove(S ystem.Windows.F orms.MouseEvent Args)
Syncfusion_Grid _Windows!Syncfu sion.Windows.Fo rms.Grid.GridCo ntrolBase.OnMou seMove(System.W indows.Forms.Mo useEventArgs)
Syncfusion_Grid _Windows!Syncfu sion.Windows.Fo rms.Grid.GridCo ntrolBaseImp.On MouseMove(Syste m.Windows.Forms .MouseEventArgs )
System_Windows_ Forms_ni!System .Windows.Forms. Control.WmMouse Move(System.Win dows.Forms.Mess age ByRef)
System_Windows_ Forms_ni!System .Windows.Forms. Control.WndProc (System.Windows .Forms.Message ByRef)
Syncfusion_Shar ed_Base!Syncfus ion.Windows.For ms.ScrollContro l.WndProc(Syste m.Windows.Forms .Message ByRef)
Syncfusion_Grid _Windows!Syncfu sion.Windows.Fo rms.Grid.GridCo ntrolBase.WndPr oc(System.Windo ws.Forms.Messag e ByRef)
System_Windows_ Forms_ni!System .Windows.Forms. Control+Control NativeWindow.On Message(System. Windows.Forms.M essage ByRef)
System_Windows_ Forms_ni!System .Windows.Forms. Control+Control NativeWindow.Wn dProc(System.Wi ndows.Forms.Mes sage ByRef)
System_Windows_ Forms_ni!System .Windows.Forms. NativeWindow.Ca llback(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
12297
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 development environment. I have an applicatin error logger which shows this error occuring (in the stack trace dump) but it again occurs at different locations in the code and occurs inconsistently. If anyone knows why it occurs or what can be...
6
3253
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." exception. The problem is that this exception isn't raised somewhere in a method, so it just shows up, and it causes the application to shut down. Is there anyway how to catch this kinds of exceptions? Can I put somewhere a
6
19944
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"}; Context.Items.Add("UserRoles", arrUserRoles); Context.User = new
0
1478
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 from DataPath, I get the following error- message when trying to edit a Form (design-mode): "Error creating window handle".
1
3924
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 occurs during a this.PointToScreen( newPos )-call, and "this" is referencing a instantiated Form class.... newPos is of class Point.
1
4017
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 creating many public properties on the form to do the same thing. At first I tried returning a DataViewRow. This worked fine until I reached the phone field on the parent table and the code Child form public DataRowView SelectedAddres ge ...
1
8610
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 the maze, it appends each step it takes to the StringBuilder. When the maze is solved, the user can click a menu item to display the results. When the menu item is clicked, I set the TextBox Text value using the StringBuilder's ToString()...
5
14330
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 consistently gets an "invalid operand" IOError when write() is called on the pipe. So I switched to subprocess. It works fine when executed "normally" (e.g. "python progname.py"), but when bundled by py2exe, it always does this:
0
1414
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 'encounter problem' occurs when i rapidly change the tabs in my application. and also in the solution coding an error occurs as ' "Error Creating Windows Handle' as 'Win32 unhandled exception is unhandled' so please tell the solution for this problem...
0
9474
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,...
0
10306
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10138
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 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...
0
9930
tracyyun
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...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
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...

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.