Cags Posted December 6, 2005 Posted December 6, 2005 An application which I have been working on recently started throwing up this error message whenever I try to debug it, has anyone got any idea what it means? An unhandled exception of type 'System.OutOfMemoryException' occurred in system.windows.forms.dll Additional information: Error creating window handle. Stepping through the code shows the constructor of the form steps through correctly, but then it crashes out as soon as entering the Main() method. Quote Anybody looking for a graduate programmer (Midlands, England)?
Administrators PlausiblyDamp Posted December 8, 2005 Administrators Posted December 8, 2005 Could you post the code, it really helps people to find problems. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Cags Posted December 8, 2005 Author Posted December 8, 2005 I would have posted the code but I didn't know what to write as it was essentially a standard form with a single class added. I copied the class to another project along with the declaration and it works fine now. I still have no idea what caused the error which isn't ideal, but I'm not going to worrry about it unless it happens again. Quote Anybody looking for a graduate programmer (Midlands, England)?
Leaders snarfblam Posted December 8, 2005 Leaders Posted December 8, 2005 Knowing almost nothing about your code, I would say that it might be possible that a logic error created an infinite loop which involved some kind of memory allocation. Kinda a stab in the dark. Quote [sIGPIC]e[/sIGPIC]
Cags Posted December 9, 2005 Author Posted December 9, 2005 Just out of interest I took a look at the old project and commented code out abit at a time to find out what was causing the error. I eventually tracked it down to a single line in the resize event of the form. I was setting myForm.ClientSize = myControl.Size this obviously caused a problem because when the constructor is ran myControl is null. It was basically an oversight, as the resize event should have been attached to the control not the form (hence making the form the right size to fit my control in). Copying my class to another project solved the problem as I was being less retarded at the time and actually attached the event to the right object. Quote Anybody looking for a graduate programmer (Midlands, England)?
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.