The information in this article applies to:
SYMPTOMSWhen LoadMenuIndirect() is used to create a menu from a menu template and the menu handle is passed to TrackPopupMenu(), Windows reports an unrecoverable application error (UAE). Windows NT and Windows 95 display the floating pop-up menu as a vertical bar. CAUSEThe menu handle returned from LoadMenuIndirect() does not point to a menu with the MF_POPUP bit set. RESOLUTIONThe following code fragment demonstrates the correct procedure to "wrap" the menu created by LoadMenuIndirect() inside another menu. This procedure sets the MF_POPUP bit properly.
Use hMenuToUse when TrackPopupMenu() is called. The values of hMenu1 and
hMenuToUse should be the same.
When the menu is no longer required, call DestroyMenu() to remove hMenuDummy. This call will also destroy hMenu1 and free the resources it used. Additional query words:
Keywords : kbcode kbMenu kbNTOS350 kbNTOS351 kbWinOS2000 kbResource kbSDKWin32 kbGrpUser kbWinOS kbWinOS95 |
Last Reviewed: January 27, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |