Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I created a rather complex usercontrol (containing about 100 controls itself).

Now I was testing the memory usage by adding 200 of them in a for-loop.

I get a 'System.ComponentModel.Win32Exception' and "Error on creating Windowhandle" as additional information.

 

When creating 100 controls it takes some time but it works.

In the application those controls are only created one at a time so the speed of creating the controls isn't important but the memory usage (worst case.about 200 of these controls will exist).

 

How can I find out what caused that exception?

The system I'm testing the app is pretty old (PIII 500, 512MB RAM).

Debug me...
  • Administrators
Posted

When you say your user control has about 100 constituent controls - what kind of controls does it contain and is there nothing you can do to reduce the number?

Also why would you need 200 of these visible at once? A form with close to 20,000 controls on it would seem rather a lot to say the least.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

The user control contains RadioButtons or Checkboxes and Textfields. It's basically a questionaire so I can't reduce the number of contained controls.

However I made a mistake. Not 200 user controls have to be visible at a time as they are on different pages but only 1-5 (depending on their size).

I wanted to check their memory usage and simply added them to my form but I guess I should just instanciate them and check the memory usage without displaying them.

Debug me...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...