BUG: Macintosh App Quits & Computer Hangs After Menu SelectionLast reviewed: August 7, 1997Article ID: Q140529 |
2.00 | 2.00WINDOWS NT | MACINTOSH kbprg kbbuglist The information in this article applies to:
SYMPTOMSThe Macintosh hangs (stops responding) after a menu is selected when you running an application created with the Visual C++ Cross-Development system.
CAUSEIf the application uses the InsertMenu function to add a menu item to a submenu using MF_BYCOMMAND, the application may fail when the menu is used. This applies to the InsertMenu function provided by the Cross-Development System, not the InsertMenu provided by the Macintosh System.
RESOLUTIONIn the hmenu argument, instead of passing the root menu handle, pass InsertMenu a handle to the menu that will hold the new menu. If the menu that will hold the new menu item is added to a submenu, pass the submenu as the hmenu argument. For example, change the following lines in the HandleCreate function of the Menu.Mac sample. This illustrates the workaround to add a pop-up menu to a submenu using MF_BYCOMMAND.
/* The original sample inserts a new top level pop-up menu */hWndMenu = GetMenu (hwnd); InsertMenu (hWndMenu, 2, MF_POPUP|MF_BYPOSITION, (DWORD)hMenu, "States");
/* Replace these lines with the following lines to insert a pop-up menu */ /* within the Colors submenu prior to the Green menu item */hWndMenu = GetMenu (hwnd); hSubMenu=GetSubMenu(hWndMenu,1); InsertMenu (hSubMenu, IDM_GREEN, MF_POPUP|MF_BYCOMMAND, (DWORD)hMenu, "States"); STATUSMicrosoft has confirmed this to be a bug in the Visual C++ 2.0 Cross Development Edition for Macintosh. We are researching the problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
|
Additional reference words: 2.00 crash quit stop
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |