[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Dialog Menu SetCheck Problem

Posted on 1998-11-11
3
Medium Priority
?
818 Views
Last Modified: 2013-11-20
Is there a way to make the SetCheck() and Enable() functions work with dialog application menus? And if so, how?  I can get SetCheck to work with SDI applications.  Using the UPDATE COMMAND UI choice to make a function.  With a dialog appliction, it does not work!  The function is being called, I checked it with a MessageBox from inside the funtion.  I'm using VC++ 6.0.
0
Comment
Question by:gregga
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Expert Comment

by:Grailman
ID: 1324512
GetDlgItem(MY_DLG_ITEM)->EnableWindow(FALSE);
GetDlgItem(MY_DLG_ITEM)->EnableWindow(TRUE);
GetDlgItem(MY_DLG_ITEM)->SetCheck(FALSE);
GetDlgItem(MY_DLG_ITEM)->SetCheck(TRUE);
0
 

Author Comment

by:gregga
ID: 1324513
This may work with control buttons but does not work with menus on dialog boxes.
0
 
LVL 2

Accepted Solution

by:
cyrilbdt earned 400 total points
ID: 1324514
BOOL CAboutDlg::OnInitDialog()
{
      CDialog::OnInitDialog();
      CMenu* pMenu = GetMenu();
      pMenu->EnableMenuItem(ID_XX, MF_BYCOMMAND|MF_GRAYED);
      pMenu->CheckMenuItem(ID_YY|MF_BYCOMMAND, MF_UNCHECKED);
      return TRUE;
}

this work just fine
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question