?
Solved

Dialog Menu SetCheck Problem

Posted on 1998-11-11
3
Medium Priority
?
811 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month15 days, 17 hours left to enroll

741 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