Click here to Skip to main content
15,915,600 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: drawing a tic tac toe grid MFC Pin
r1ryder1-Mar-05 11:50
r1ryder1-Mar-05 11:50 
GeneralRe: drawing a tic tac toe grid MFC Pin
Christian Graus1-Mar-05 12:06
protectorChristian Graus1-Mar-05 12:06 
Generalms word 2000 Pin
rjnl1-Mar-05 8:18
rjnl1-Mar-05 8:18 
GeneralRe: ms word 2000 Pin
rjnl1-Mar-05 15:37
rjnl1-Mar-05 15:37 
GeneralI need to append to this string Pin
Tom Wright1-Mar-05 8:07
Tom Wright1-Mar-05 8:07 
GeneralRe: I need to append to this string Pin
peterchen1-Mar-05 8:57
peterchen1-Mar-05 8:57 
GeneralRe: I need to append to this string Pin
Tom Wright1-Mar-05 11:10
Tom Wright1-Mar-05 11:10 
GeneralRe: I need to append to this string Pin
peterchen1-Mar-05 11:37
peterchen1-Mar-05 11:37 
GeneralRe: I need to append to this string Pin
Tom Wright1-Mar-05 12:07
Tom Wright1-Mar-05 12:07 
GeneralRe: I need to append to this string Pin
peterchen1-Mar-05 18:37
peterchen1-Mar-05 18:37 
GeneralRe: I need to append to this string Pin
Tom Wright1-Mar-05 12:08
Tom Wright1-Mar-05 12:08 
GeneralCustom icon for an app Pin
Alton Williams1-Mar-05 7:07
Alton Williams1-Mar-05 7:07 
GeneralRe: Custom icon for an app Pin
Blake Miller1-Mar-05 7:19
Blake Miller1-Mar-05 7:19 
GeneralRe: Custom icon for an app Pin
Alton Williams1-Mar-05 7:31
Alton Williams1-Mar-05 7:31 
GeneralRe: Custom icon for an app Pin
Michael Dunn1-Mar-05 7:36
sitebuilderMichael Dunn1-Mar-05 7:36 
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 

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.