Error creating windows Handle
-
I am not sure what created this error. but the error which I got in my c# application says "Windows form exception Error creating windows handle". I dont know whether it exceded the number of handles but I am surprised that limit is atleast 1000 and I dont have 1000 controls on my form.My application has single form and one tabcontrol with 7 tabpages. There are many callback event firing in the application these events populate the listboxes on each tabpage. I read it in some message forums that controls on tabpage does exceed the number of windows handle used. IF anyone has any idea about this issue please let me know.All responses will be highly appreciated. Mandar Patankar Microsoft Certified professional
-
I am not sure what created this error. but the error which I got in my c# application says "Windows form exception Error creating windows handle". I dont know whether it exceded the number of handles but I am surprised that limit is atleast 1000 and I dont have 1000 controls on my form.My application has single form and one tabcontrol with 7 tabpages. There are many callback event firing in the application these events populate the listboxes on each tabpage. I read it in some message forums that controls on tabpage does exceed the number of windows handle used. IF anyone has any idea about this issue please let me know.All responses will be highly appreciated. Mandar Patankar Microsoft Certified professional
-
Can you post the complete error message (i.e. the one in Exception.ToString() so that we can see what was being called)?
You know you're a Land Rover owner when the best route from point A to point B is through the mud. Ed
Thanks for replying ed. this is the error message An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.windows.forms.dll Additional information: Error creating window handle. this error is random. Application works fine for some time and suddenly when you are switching between tab pages this error is raised. Mandar Patankar Microsoft Certified professional
-
Thanks for replying ed. this is the error message An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.windows.forms.dll Additional information: Error creating window handle. this error is random. Application works fine for some time and suddenly when you are switching between tab pages this error is raised. Mandar Patankar Microsoft Certified professional
Have you tried running it inside the debugger and investigating the current state of the variables. Take a look at the stack trace as well if possible (this should be included in the exception text). You'll just have to experiment and try and find out if there are any common things occurring at the same time as the exception (such as an object being null, stack overflow etc).
You know you're a Land Rover owner when the best route from point A to point B is through the mud. Ed
-
Have you tried running it inside the debugger and investigating the current state of the variables. Take a look at the stack trace as well if possible (this should be included in the exception text). You'll just have to experiment and try and find out if there are any common things occurring at the same time as the exception (such as an object being null, stack overflow etc).
You know you're a Land Rover owner when the best route from point A to point B is through the mud. Ed
Ed, thanks for your response but I figured out the problem. I was running some background threads in my application and these threads were updating the windows controls like listbox and textbox.So, if user clicks on the form while these threads are updating these controls a exception was raised. The solution which I figured out and probably works fine is updating controls using delegate invoke from background threads. Common example of using methodinvoker and creating static object of the form class. Thanks Mandar Patankar Microsoft Certified professional
-
Ed, thanks for your response but I figured out the problem. I was running some background threads in my application and these threads were updating the windows controls like listbox and textbox.So, if user clicks on the form while these threads are updating these controls a exception was raised. The solution which I figured out and probably works fine is updating controls using delegate invoke from background threads. Common example of using methodinvoker and creating static object of the form class. Thanks Mandar Patankar Microsoft Certified professional