Page 1 of 1

Many windows in memory?

Posted: Fri Aug 12, 2011 11:43 am
by Nexus100
Hi Coders, Thanks in advance :wink:

My application has quite a few windows that are used which is all fine. I was just wondering which is the best way to 'use' them.

Is it better to create all the windows in one go (as invisible) and then just show them as required, or when needed, create them then and then get rid of them again when not needed?

Just thinking about memory really, if it could cause a problem. Oh by the way I will have about 15 windows in my application!


Thanks

Re: Many windows in memory?

Posted: Fri Aug 12, 2011 12:20 pm
by luis
Normally you create the window when you need it.
Usually there is no reason to keep 1 window visible and 14 hidden just because you could use them later :)
A window even if hidden has a cost in term or resources (memory, cpu, gdi objects, and so on).
So unless you have a valid reason I would suggest to create/destroy them as needed.

Re: Many windows in memory?

Posted: Sat Aug 13, 2011 12:53 am
by MachineCode
luis wrote:unless you have a valid reason I would suggest to create/destroy them as needed.
+1