Hello everyone :

I am doing one application for the SetCheck(); and found one problem occured , that is :

Sometimes I used ((CButton *)GetDlgItem(nID))->SetCheck(1) , that can work successfully and no any erro , but sometimes I use the sme one at somewhere, then get erro as below :

error C2660:'GetDlgItem' : function does not take 1 parameters
error C2227: left of '->SetCheck' must point to class/struct/union

I also try to use :

CWnd *pwnd=GetDlgItem(nID);
(CButton *)pwnd->SetCheck(1);

also get erro :

error C2660: 'GetDlgItem' : function does not take 1 parameters
error C2039: 'SetCheck' : is not a member of 'CWnd'
e:\Visual Studio\VC98\MFC\INCLUDE\afxwin.h(1899) : see declaration of 'CWnd'

I am in doubt now , and Could anyone give me any idea ?

Thanks in advance !