I have a dialog that has several Infragistics controls on it - all 15.2 versions latest build.
The controls are mostly buttons, a check box, and a few text boxes.
My customers are getting the following error message but I cannot recreate it. Unlike other messages, there are also no line numbers to steer me in the right direction. Any ideas on what could be causing this?
Total Physical Memory: 4,207,882,240Available Physical Memory: 1,525,956,608OS: Microsoft Windows 8.1System.ComponentModel.Win32Exception (0x80004005): Error creating window handle. at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp) at System.Windows.Forms.Control.CreateHandle() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Thank you in advance!
Hi,
There's not much information here to go on. If your application is failing on CreateHandle, then it's most likely caused by a GDI memory leak. The Physical memory numbers you listed here aren't really relevant to that - you need to look at the number of handles created.
In any case, this kind of thing generally happens if you application is creating a lot of windows or images and not properly disposing them. This could be something your code is doing, or it's possible it's a bug somewhere in the controls. But without being able to reproduce it, there's not much anyone can do to track it down.
If it were me, I'd check the code for places where you are created, loading, or assigning images and make sure those images are properly disposed when they are no longer needed.
I've looked through the code. We don't use any images via code. However, we use images on several buttons that are set in the designer but don't change.
Could those be the issue? Or any other ideas?
Thank you!
That seems very unlikely. Cases like that usually occur when you are creating multiple images at run-time. If you are not doing that, then I'm afraid I don't really have any other idea. If I were going to take a completely wild stab in the dark, I'd say this could be related to threading. Is your application using multiple threads?
Hi Jeff,
Wow this is an old thread. :)
If you are creating images at run-time, then it's your responsibility to dispose of those images when they are no longer needed. The grid can't do that for you because the grid can't assume that just because it's being disposed that those images are not being used somewhere else in your application. Of course, if you are closing the form and no one else is referencing the images, they will eventually get cleaned up by the DotNet garbage collector. So this would only be a problem if some object that is still in memory is holding a reference to those images.
I found an area where small icons are being placed into a grid.
As the form is closed, the grid's datasource is set to nothing and then mygrid.dispose is being called.
This doesn't seem to have fixed the issue. Should we be doing something else to clear out the graphic icons that were used in the grid before removing the datasource and calling dispose?