.NETGURU
Error creating window handle
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.sdk.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Ramana
Hi,
I am working on a windows application (C#) which has number of tab pages
and each tab page contains large number of controls (labels, text boxes,
buttons etc).
After facing the window creation problem, I came to know that the maximum
no. of window handles per process is limited to 10000.
I thought of calculating the no. of user objects in the current process and
restrict the user to add more tabs pages if the total no. of user objects
exceeds 1000.

After few trials, I found that the 1000 limit is not the only reason for
this error.
If I run one single instance of my application with out any other
application on my desktop, then the error is coming at 1000 user objects.
But if I start two instances of the same application or If start few other
applications on my machine, then I am getting the "error creating window
handle" error before reaching the 1000 limit. Some times I am getting the
error after creating few hundreds of user objects also.

What is the limiting factor (other than the number of user objects) for
creating more windows. I have 1GB RAM on a 2.8 GHz machine with WinXP and I
don't think RAM is the problem.
I would like check for this limit before creating the new tab page itself.

Advance thanks.
-Ramana

Reply to this message...
 
    
Stoitcho Goutsev \(100\) [C# MVP] (VIP)
Ramana,

Indeed windows NT/XP has 10,000 windwos handles per process limit. But this
is a huge number. Rule of thumb is to have no more then 5,000 handles if
good performance. Application having 5,000 hwnds is considered as huge. For
win9x limit the limit is more severe. 200-250 hwnds at most.

Anyways even with 1,000 window handles you should consider redesign your
application. E.g. if you have grid with comboboxes for some fo the fields
consider reusing one combobox for all the cells. If you have control with a
lot of labels consider painting those labels your self instead of using
controls or create as many label control as you need to show at the same
time on the screen.
You have options I believe.

--
HTH
Stoitcho Goutsev (100) [C# MVP]

"Ramana" <Click here to reveal e-mail address> wrote in message
news:ePU3l$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification