CMAINFRAME * PFRAME = (CMAINFRAME *) AFXGetApp () -> m_pmainwnd;
Cmenu * pmenu =
Pframe->
Getment ();
IF (PMenu) Pmenu-> EnableMenuItem (index, mf_byposition | mf_grayed); if in the Frame frame, only the code of the red part