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

Posted on 2005-05-05
Last Modified: 2013-11-20
Hi All,

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

Thanks in Advance
Question by:SueshPadmanabhan
    LVL 6

    Accepted Solution

    There is no limit. It is limited by the number of windows (controls) the system can handle. I have seen some limitations with that on Windows ME. Otherwise it should be fine.
    LVL 43

    Expert Comment

    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 !!!)
    LVL 11

    Expert Comment

    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.
    LVL 11

    Expert Comment

    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.
    LVL 3

    Expert Comment

    Unlimited depends upon the available memory. You have to tweak the MFC resource.h file manually

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
    Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now