Link to home
Start Free TrialLog in
Avatar of SueshPadmanabhan
SueshPadmanabhan

asked on

How many controls will be placed in a Dialog using MFC?>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi All,

     Could any one tell that maximum number of controls in a dialog using mfc?


Thanks in Advance
ASKER CERTIFIED SOLUTION
Avatar of nabehs
nabehs

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AndyAinscow
A dialog with a large number of controls will probably be totally unusable for the user.  (Not many have screen resolution of roughly 16000 x 32000 and a 4m monitor !!!)
Avatar of KurtVon
KurtVon

I suppose the limit would be set by the number of available dialog item IDs.  Normally they can be reused, and since 0 is forbidden that would limit you to 65,535 (for backwards compatability) or 4,294,967,295 in NT/2000/XP pro.  I can't guess about XP home, though.

However, MFC doesn't reuse dialog IDs, and it starts at 1000 and blocks at, I believe, 32,767.  That would limit you to 31,767 if it is the only dialog, less if there are others.

Hope this helps.
Oh, and if you are generating the dialog items programatically, you can start at one more than the largest pre-existing dialog ID and continue to 32,767 without interrupting any MFC behavior.  After that may work, but I wouldn't count on it . . . MFC is a little messy to know if bugs will show up going outside that range.

Ideally you would create the dialog resource as early as possible so that the control with the largest dialog ID is as small as possible.
Unlimited depends upon the available memory. You have to tweak the MFC resource.h file manually