ANicoll

I am using Visual C++ 2005 and need to create a menu heirarchy that has thousands of items. As I approach about 8000 items, the menu starts to display incorrectly. Parts of the menu that should be displayed as subitems appear as top level items.

I never receive an error as I enter new items in the menu structure, nor do I receive any errors about overflowing the menu heap as the application starts. The menu just display incorrectly.

Is there a limit on the number of menu items Or a limit on the total size of the menu Why aren't any errors being reported Any help would be greatly appreciated.



Re: Visual C++ General Menu limitations

Nishant Sivakumar

I am not going to bet my life on this, but I believe menu resources have a 64 KB limit. So when you have around 8000 items, you are probably hitting this limit.




Re: Visual C++ General Menu limitations

ANicoll

I believe this only applies to Window 3.1. This quote is from the Microsoft website.

"In Windows version 3.1, window and menu data is maintained in two 16-bit heaps. This limits window and menu data to 64k each. Windows 95 uses 32-bit heaps for window and menu data, thus greatly expanding the limits placed on the number of items contained in these heaps."





Re: Visual C++ General Menu limitations

Nishant Sivakumar

I meant the limit for an individual menu (not the data size limit).

By the way, are you dynamically populating the menu or are you entering these 8000 entries into the resource editor If the latter, I wonder if it's a limitation of the resource compiler.






Re: Visual C++ General Menu limitations

ANicoll

The menu is created in the resource editor. It looks like you are probably correct. I turned on the verbose option of the resource compiler. When the menu size was 65580 or greater, the menu would fail.