ymca2003
Messages postés2070Date d'inscriptionmardi 22 avril 2003StatutMembreDernière intervention 3 juillet 20067 8 févr. 2004 à 15:21
Si ton menu est dans un dialogue (ce que je suppose vu l'appel à UpdateData), UPDATE_COMMAND_UI ne marche pas
extrait d'un articla à ce sujet :
The code which dispatches ON_UPDATE_COMMAND_UI messages for menu items is implemented inside CFrameWnd, NOT CWnd. Since CDialog is derived from CWnd, you don't inherit this code. Bummer.
What can you do ? Well you can roll your own solution using the WM_INITMENUPOPUP message. For sample code, see this knowledgebase article:
You can also handle WM_KICKIDLE (which exists to support OnIdle-type functionality for dialogs) to achieve this : see John Wismar's article on CodeGuru, at the following URL :