none
"The maximum supported number of controls on dialog is 255" RRS feed

  • Question

  • Hello,

    I need to use a project, but on clicking a dialog (which has many controls inside) I get:

    It is C++ project, I think it is MFC.

    On clicking a dialog with many controls I get:

    This is a link to the error I get cliking the dialog:

    https://drive.google.com/file/d/17OP3u_HeQbfL6yMncuEPrAE2cbVV7Mcj/view?usp=sharing

    It says:

    "

    "The maximum supported number of controls on dialog is 255. Your dialog might not be displayed correctly."

    Not sure I understand it.

    Does it mean that it shall work but only might not be displayed correctly ?

    Thank you,

    Ran


    • Edited by ransh1234 Sunday, December 31, 2017 9:51 AM
    • Moved by Stanly Fan Tuesday, January 2, 2018 1:25 AM C++ related
    Sunday, December 31, 2017 9:50 AM

All replies

  • It says:
    ""The maximum supported number of controls on dialog is 255. Your dialog might not be displayed correctly."

    I suspect it's referring to an limitation on older versions of Windows. If it works OK on your lowest supported version of Windows,
    and works OK in the dialog editor, I'd ignore it.

    Having said that, however do your users use your dialog with so many controls on it? It might be better to partition the controls
    into property pages.

    Dave

    Sunday, December 31, 2017 5:23 PM
  • Hi ransh,

    According to your description, your issue is more related about C++ project. And this forum is discussing and asking questions about the Windows Form and ClickOnce, I will move this thread to corresponding forum: C++ forum for dedicated information.

    Thank you for your understanding.

    Regards,

    Stanly


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 2, 2018 1:24 AM
  • Hi ransh1234,

    thanks for posting here.

    >>"The maximum supported number of controls on dialog is 255. Your dialog might not be displayed correctly."

    Not sure I understand it.

    Does it mean that it shall work but only might not be displayed correctly ?

    Please provide more information about your project. What's the version is your project?

    In the order version, there has a maximum of 255 that can be added in the resource editor, to a single dialog object. However, you could add more at runtime.

    Or you could try to update your vs to the latest version and try again.

    https://www.visualstudio.com/downloads/

    Hope this could be help of you.

    Best Regards,

    Baron Bi


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 2, 2018 8:17 AM
  • >Or you could try to update your vs to the latest version and try again.

    The latest version (15.6 preview) still has that warning message.

    Tuesday, January 2, 2018 8:29 AM
  • Hello,

    you cannot put more than 255 controls in one formview/dialog. VS will not accept more controls if you try to put them into the control.

    As David already said, you should redesign your window and put controls in thematic property pages because no user will overlook and grasp all your controls in one window.

    Regards, Guido

    Tuesday, January 2, 2018 10:52 AM
  • >you cannot put more than 255 controls in one formview/dialog. VS will not accept more controls if you try to put them into the control.

    I think it used to prevent it (maybe a long time ago), it doesn't in current versions.

    When you do create such a monster, when you re-open it in the dialog editor, it gives rise to the message:

    ---------------------------
    Microsoft Visual Studio
    ---------------------------
    The maximal supported number of controls on a dialog is 255. Your dialog might not be displayed correctly.
    ---------------------------
    OK   ---------------------------

    Tuesday, January 2, 2018 12:04 PM
  • Perhaps the following will add some clarity...from The evolution of dialog templates – 32-bit Classic Templates - "This is basically the same as the 16-bit dialog template, except that there's a new dwExStyle field, and the cItems went from a BYTE to a WORD. Consequently, the maximum number of controls per 32-bit dialog is 65535. That should be enough for a while. "

    Tuesday, January 2, 2018 12:27 PM
  • On a (vaguely?) related issue, is the number of simultaneously displayed dialogs (or dialog controls) limited?

    I have an app that creates user-defined dialogs based on a script file.  Each dialog has a number of controls, ranging from 3 to ~90 but typically ~25.  Each of these dialogs (effectively) transmits serial data to a piece of hardware.

    In the past I have stress-tested this hardware by opening all dialogs at once but recently this has started causing the app to crash,  The current number of dialogs is ~205.

    Monday, July 16, 2018 7:45 AM
  • On a (vaguely?) related issue, is the number of simultaneously displayed dialogs (or dialog controls) limited?

    It's probably best to start a new thread for your specific question.

    In the past I have stress-tested this hardware by opening all dialogs at once but recently this has started causing the app to crash

    Presumably something in your code has changed.
    You'll need to debug it and find the underlying cause.

    Dave

    Monday, July 16, 2018 8:12 AM
  • On a (vaguely?) related issue, is the number of simultaneously displayed dialogs (or dialog controls) limited?

    I have an app that creates user-defined dialogs based on a script file.  Each dialog has a number of controls, ranging from 3 to ~90 but typically ~25.  Each of these dialogs (effectively) transmits serial data to a piece of hardware.

    In the past I have stress-tested this hardware by opening all dialogs at once but recently this has started causing the app to crash,  The current number of dialogs is ~205.

    Your question has nothing to do with the original question. So open a new question. In the original question they talk about 255 controls in one dialog.  You are asking about many dialogs opened at one time. So this is a new topic. And describe your dialogs more detailed then. You can only open one modal dialog at a time, or you open modeless dialogs.
    A long time ago, I had a worse-written programme that could open far too many modeless dialogs too. It was only a point of memory when the programme freezed. Did you check Task Manager, how much memory is used in total when it "crashes"? - although I don't think that it "crashes", it only hangs, maybe because of insufficient memory. Or your Serial port hangs, because I don't think that you have 205 Serial ports at your computer, so the Serial communication hangs.

    Regards, Guido

    Monday, July 16, 2018 8:16 AM