Click here to Skip to main content
15,893,487 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Custom icon for an app Pin
David Crow1-Mar-05 9:07
David Crow1-Mar-05 9:07 
QuestionSetting checkbox state in OnInitDialog? Pin
1-Mar-05 6:59
suss1-Mar-05 6:59 
AnswerRe: Setting checkbox state in OnInitDialog? Pin
Blake Miller1-Mar-05 7:23
Blake Miller1-Mar-05 7:23 
GeneralRe: Setting checkbox state in OnInitDialog? Pin
Member 16972731-Mar-05 7:33
Member 16972731-Mar-05 7:33 
GeneralRe: Setting checkbox state in OnInitDialog? Pin
Blake Miller1-Mar-05 7:41
Blake Miller1-Mar-05 7:41 
AnswerRe: Setting checkbox state in OnInitDialog? Pin
Ravi Bhavnani1-Mar-05 7:27
professionalRavi Bhavnani1-Mar-05 7:27 
GeneralRe: Setting checkbox state in OnInitDialog? Pin
Member 16972731-Mar-05 7:58
Member 16972731-Mar-05 7:58 
AnswerRe: Setting checkbox state in OnInitDialog? Pin
Alton Williams1-Mar-05 7:27
Alton Williams1-Mar-05 7:27 
Simple, there's two ways to do it:

  1. The first way is to use the GetDlgItem(control's ID)
    cast it to a pointer to a type CButton as viz:
    <br />
    	// TODO: Add extra initialization here<br />
    	CButton *pCheck = reinterpret_cast<CButton *>(GetDlgItem(IDC_CHECK1));<br />
    	pCheck->SetCheck(TRUE);<br />

  2. of:
  3. Using Class Wizard (or maunally), map the check box to a "Control" category variable of type CButton (default)
    bot in your dialog's header file
    <br />
    // Dialog Data<br />
    	//{{AFX_DATA(CCheckDlg)<br />
    	enum { IDD = IDD_CHECK_DIALOG };<br />
    	CButton	m_check;<br />
    	//}}AFX_DATA<br />

    and in the DoDataExchange method
    <br />
    <br />
    void CCheckDlg::DoDataExchange(CDataExchange* pDX)<br />
    {<br />
    	CDialog::DoDataExchange(pDX);<br />
    	//{{AFX_DATA_MAP(CCheckDlg)<br />
    	DDX_Control(pDX, IDC_CHECK1, m_check);<br />
    	//}}AFX_DATA_MAP<br />
    }<br />

    have been added (or you have to insert DDX_Control(pDX, IDC_CHECK1, m_check); if done manuallY)
    the code in OnInitDialog is such:
    <br />
    	// TODO: Add extra initialization here<br />
    	m_check.SetCheck(TRUE);<br />



Happy programming,
Alton
GeneralRe: Setting checkbox state in OnInitDialog? Pin
Member 16972731-Mar-05 7:58
Member 16972731-Mar-05 7:58 
GeneralRe: Setting checkbox state in OnInitDialog? Pin
David Crow1-Mar-05 9:05
David Crow1-Mar-05 9:05 
QuestionWhat format is this file in and how to open it in C++ Pin
Member 121962521-Mar-05 6:58
Member 121962521-Mar-05 6:58 
AnswerRe: What format is this file in and how to open it in C++ Pin
Michael Dunn1-Mar-05 7:41
sitebuilderMichael Dunn1-Mar-05 7:41 
GeneralRe: What format is this file in and how to open it in C++ Pin
Tommy2d1-Mar-05 9:54
Tommy2d1-Mar-05 9:54 
GeneralRe: What format is this file in and how to open it in C++ Pin
Michael Dunn1-Mar-05 10:44
sitebuilderMichael Dunn1-Mar-05 10:44 
GeneralRe: What format is this file in and how to open it in C++ Pin
Tommy2k1-Mar-05 12:19
Tommy2k1-Mar-05 12:19 
GeneralRe: What format is this file in and how to open it in C++ Pin
normanS1-Mar-05 20:51
normanS1-Mar-05 20:51 
GeneralRe: What format is this file in and how to open it in C++ Pin
Tommy2d2-Mar-05 4:58
Tommy2d2-Mar-05 4:58 
QuestionWhat format is this file in and how to open it in C++ Pin
Member 121962521-Mar-05 6:58
Member 121962521-Mar-05 6:58 
GeneralAdding a button to all active windows... Pin
price1-Mar-05 6:34
price1-Mar-05 6:34 
GeneralForce delete file Pin
User 17288841-Mar-05 5:32
User 17288841-Mar-05 5:32 
GeneralRe: Force delete file Pin
David Crow1-Mar-05 6:02
David Crow1-Mar-05 6:02 
GeneralRe: Force delete file Pin
Blake Miller1-Mar-05 6:07
Blake Miller1-Mar-05 6:07 
GeneralRe: Force delete file Pin
Maximilien1-Mar-05 6:24
Maximilien1-Mar-05 6:24 
Generalactivex - save graphics to file Pin
sstoyan1-Mar-05 4:44
sstoyan1-Mar-05 4:44 
GeneralRe: activex - save graphics to file Pin
Roger Allen1-Mar-05 5:30
Roger Allen1-Mar-05 5:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.