Click here to Skip to main content
15,889,834 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCalling All CListCtrl Experts Pin
Spoodles7-Sep-05 8:54
Spoodles7-Sep-05 8:54 
AnswerRe: Calling All CListCtrl Experts Pin
Mircea Puiu7-Sep-05 20:41
Mircea Puiu7-Sep-05 20:41 
GeneralRe: Calling All CListCtrl Experts Pin
Spoodles8-Sep-05 3:11
Spoodles8-Sep-05 3:11 
GeneralRe: Calling All CListCtrl Experts Pin
Mircea Puiu8-Sep-05 4:02
Mircea Puiu8-Sep-05 4:02 
QuestionUpdating CheckBoxes Pin
DanYELL7-Sep-05 5:08
DanYELL7-Sep-05 5:08 
AnswerRe: Updating CheckBoxes Pin
Mircea Puiu7-Sep-05 5:18
Mircea Puiu7-Sep-05 5:18 
GeneralRe: Updating CheckBoxes Pin
DanYELL7-Sep-05 5:57
DanYELL7-Sep-05 5:57 
GeneralRe: Updating CheckBoxes Pin
bugDanny7-Sep-05 9:18
bugDanny7-Sep-05 9:18 
The GetDlgItem function retrieves the handle of a control in the specified dialog box.

HWND GetDlgItem(
HWND hDlg, // handle of dialog box
int nIDDlgItem // identifier of control
);

Notice the above text from MSDN.

DanYELL wrote:
I tried using null for the 2nd variable

Don't use NULL for the 2nd variable:
(1) Because the HWND structure was supposed to be the first variable, hence your original error:
DanYELL wrote:
error C2664: 'GetDlgItem' : cannot convert parameter 1 from 'int' to 'struct HWND__ *'

(2) Because the HWND parameter in GetDlgItem is supposed to be the handle of the dialog that this dialog item is on. Try possibly, this, the word "this" referring to "the current dialog".

The simpler, though perhaps more unpopular/messier way would be to use UpdateData(), but not UpdateData(FALSE). The check boxes usually function pretty cool by themselves (i.e. checking an unchecking themselves when you click on them), but you're trying to control a partner check box. So, try something like:

<br />
void OnCheck20(void){<br />
  UpdateData(TRUE); //This gets the current state of all the dialog items, so you won't be overwriting anything.<br />
<br />
  if(m_Check20 == true){<br />
    m_Check21 = false;<br />
    UpdateData(FALSE);<br />
  }<br />
  else if(m_Check20 == false){ // The user just hit the button from true to false.<br />
    // Do nothing, if you want the user to be able to unselect these options.<br />
  }<br />
}<br />


Write a similar function for the other check box. You just gotta use the UpdateData(TRUE) so you don't change all the other controls to their last updated state.

Danny
GeneralRe: Updating CheckBoxes Pin
Mircea Puiu7-Sep-05 20:09
Mircea Puiu7-Sep-05 20:09 
AnswerRe: Updating CheckBoxes Pin
toxcct7-Sep-05 5:42
toxcct7-Sep-05 5:42 
AnswerRe: Updating CheckBoxes Pin
David Crow7-Sep-05 6:25
David Crow7-Sep-05 6:25 
AnswerRe: Updating CheckBoxes Pin
Jack Puppy7-Sep-05 15:37
Jack Puppy7-Sep-05 15:37 
QuestionDll and XP theme Pin
hari_rs7-Sep-05 4:02
hari_rs7-Sep-05 4:02 
AnswerRe: Dll and XP theme Pin
Mircea Puiu7-Sep-05 5:11
Mircea Puiu7-Sep-05 5:11 
GeneralRe: Dll and XP theme Pin
pranavamhari7-Sep-05 5:39
pranavamhari7-Sep-05 5:39 
AnswerRe: Dll and XP theme Pin
ThatsAlok7-Sep-05 18:43
ThatsAlok7-Sep-05 18:43 
QuestionHow to get the time taken by application Pin
Anonymous7-Sep-05 4:01
Anonymous7-Sep-05 4:01 
AnswerRe: How to get the time taken by application Pin
David Crow7-Sep-05 4:15
David Crow7-Sep-05 4:15 
AnswerRe: How to get the time taken by application Pin
Trollslayer7-Sep-05 4:43
mentorTrollslayer7-Sep-05 4:43 
GeneralRe: How to get the time taken by application Pin
David Crow7-Sep-05 6:41
David Crow7-Sep-05 6:41 
GeneralRe: How to get the time taken by application Pin
Graham Bradshaw7-Sep-05 7:01
Graham Bradshaw7-Sep-05 7:01 
GeneralRe: How to get the time taken by application Pin
David Crow7-Sep-05 7:32
David Crow7-Sep-05 7:32 
QuestionRe: How to get the time taken by application Pin
ThatsAlok7-Sep-05 19:01
ThatsAlok7-Sep-05 19:01 
AnswerRe: How to get the time taken by application Pin
David Crow8-Sep-05 2:12
David Crow8-Sep-05 2:12 
GeneralRe: How to get the time taken by application Pin
ThatsAlok8-Sep-05 17:59
ThatsAlok8-Sep-05 17:59 

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.