void CBNDlg::OnBnClickedEnableDisable()
{
BOOL bState=GetDlgItem(IDC_LEFT)->IsWindowEnabled();
GetDlgItem(IDC_LEFT)->IsWindowEnabled(!bState);
GetDlgItem(IDC_CENTER)->IsWindowEnabled(!bState);
GetDlgItem(IDC_RIGHT)->IsWindowEnabled(!bState);
GetDlgItem(IDC_ENABLE_DISABLE)->SetWindowText(bState?"DISABLE":"ENABLE");
BNDlg.cpp
d:\程序设计\bn\bn\bndlg.cpp(167) : error C2664: 'CWnd::SetWindowTextW' : cannot convert parameter 1 from 'const char *' to 'LPCTSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\程序设计\bn\bn\bndlg.cpp(173) : error C2660: 'CWnd::IsWindowEnabled' : function does not take 1 arguments
d:\程序设计\bn\bn\bndlg.cpp(174) : error C2660: 'CWnd::IsWindowEnabled' : function does not take 1 arguments
d:\程序设计\bn\bn\bndlg.cpp(175) : error C2660: 'CWnd::IsWindowEnabled' : function does not take 1 arguments
d:\程序设计\bn\bn\bndlg.cpp(176) : error C2664: 'CWnd::SetWindowTextW' : cannot convert parameter 1 from 'const char *' to 'LPCTSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\程序设计\bn\bn\bndlg.cpp(200) : error C2065: 'm_nIDofLastButton' : undeclared identifier

解决方案 »

  1.   

    搞错了是这个: GetDlgItem(IDC_ENABLE_DISABLE)->SetWindowText(bState?"DISABLE":"ENABLE");rror C2664: 'CWnd::SetWindowTextW' : cannot convert parameter 1 from 'const char *' to 'LPCTSTR'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    d:\程序设计\bn\bn\bndlg.cpp(176) : error C2664: 'CWnd::SetWindowTextW' : cannot convert parameter 1 from 'const char *' to 'LPCTSTR'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
      

  2.   

    是不是编成Unicode版本咯???
      

  3.   

    奇怪我换成Use Multi-Byte Character Set
    就是对的呢?
    两个有什么区别么?