473,888 Members | 1,708 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 9131
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
12302
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
3261
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
19947
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
1481
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
3927
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
4025
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
8616
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
14341
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
1416
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
9959
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9800
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
10772
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...
1
10880
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5812
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6012
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4638
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4241
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3246
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.