I'm getting the runtime error "Error creating window handle". From my research, I know this error typically indicates that an application has exceeded Windows' 10,000 handle limit, and I should address the error by making sure handles aren't created unnecessarily and are disposed of properly.
However, I can't find any documentation on what causes a window handle to be created. Is a window handle created each time I instantiate a form? Each time I instantiate a control? Each time I instantiate a class? Or what?
Would it be true to say that for light-UI applications, there is no need to be particularly concerned with the number of handles used, but for applications with many graphical elements, programmers must take measures to limit the number of window handles? Is that what "windowless controls" and "lightweight controls" are all about? Are there other relevant concepts I should know about?
Up to now, I haven't thought of my application as particularly UI-intensive. However, it does display a grid of charts, where each chart is a user control composed of several component controls. For large analyses, the total number of controls might reach into the thousands. Assuming I want to retain this grid, are there specific techniques I can apply to keep the handle count down? For instance, is there a way to "render" a control so that it is still visible, but no longer requires a window handle?
-TC