warning C4003: not enough actual parameters for macro 'SubclassWindow' : error C2059: syntax error : '(' : error C2039: 'hwnd' : is not a member of 'CContainedWindowT<class ATL::CWindow,class ATL::CWinTraits<1442840576,0> >' : error C2039: 'AfxMessageBox' : is not a member of 'CContainedWindowT<class ATL::CWindow,class ATL::CWinTraits<1442840576,0> >' : error C2039: 'str' : is not a member of 'CContainedWindowT<class ATL::CWindow,class ATL::CWinTraits<1442840576,0> >' : error C2039: 'Format' : is not a member of 'CContainedWindowT<class ATL::CWindow,class ATL::CWinTraits<1442840576,0> >' Error executing cl.exe.vcwmp.dll - 5 error(s), 1 warning(s)
m_bWindowOnly = TRUE;再通过CContainedWindow::SubclassWindow子类化控件。
HWND hwnd;
CSliderCtrl *m_slider1;
hwnd = GetDlgItem(IDC_slider1);
m_slider1=(CSliderCtrl *)hwnd;
m_slider1->SetRange(0,100);
if ( IsWindow(hwnd) )
{
CContainedWindow ctlObj;
ctlObj.SubclassWindow( hwnd );
}
: error C2059: syntax error : '('
: error C2039: 'hwnd' : is not a member of 'CContainedWindowT<class ATL::CWindow,class ATL::CWinTraits<1442840576,0> >'
: error C2039: 'AfxMessageBox' : is not a member of 'CContainedWindowT<class ATL::CWindow,class ATL::CWinTraits<1442840576,0> >'
: error C2039: 'str' : is not a member of 'CContainedWindowT<class ATL::CWindow,class ATL::CWinTraits<1442840576,0> >'
: error C2039: 'Format' : is not a member of 'CContainedWindowT<class ATL::CWindow,class ATL::CWinTraits<1442840576,0> >'
Error executing cl.exe.vcwmp.dll - 5 error(s), 1 warning(s)