Solved

Dialog Menu SetCheck Problem

Posted on 1998-11-11
3
801 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
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 100 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question regarding Copy/Paste 16 96
C++ BOOL WINAPI ReadFile fails on windows 10 when reading from USB cable 9 476
fizzArray2 challenge 1 91
Making an alias 7 101
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…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

828 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