请问了:
这是俄罗斯方块的例子,加了代码后工程运行错误,我该怎样改?以我vc新手水平改不了了啊!!!谢谢!!!工程如下:http://vccode.com/attachment.php?s=&postid=44783
错误提示如下:
----Configuration: 1 - Win32 Debug--------------------
Compiling...
1.cpp
c:\documents and settings\007\桌面\装vc代码\1\1dlg.h(72) : error C2535: 'void __thiscall CMy1Dlg::OnDown(void)' : member function already defined or declared
c:\documents and settings\007\桌面\装vc代码\1\1dlg.h(36) : see declaration of 'OnDown'
1Dlg.cpp
c:\documents and settings\007\桌面\装vc代码\1\1dlg.h(72) : error C2535: 'void __thiscall CMy1Dlg::OnDown(void)' : member function already defined or declared
c:\documents and settings\007\桌面\装vc代码\1\1dlg.h(36) : see declaration of 'OnDown'
C:\Documents and Settings\007\桌面\装vc代码\1\1Dlg.cpp(130) : error C2065: 'm_size' : undeclared identifier
C:\Documents and Settings\007\桌面\装vc代码\1\1Dlg.cpp(130) : error C2228: left of '.cx' must have class/struct/union type
C:\Documents and Settings\007\桌面\装vc代码\1\1Dlg.cpp(131) : error C2228: left of '.cy' must have class/struct/union type
C:\Documents and Settings\007\桌面\装vc代码\1\1Dlg.cpp(144) : error C2228: left of '.cx' must have class/struct/union type
C:\Documents and Settings\007\桌面\装vc代码\1\1Dlg.cpp(145) : error C2228: left of '.cy' must have class/struct/union type
C:\Documents and Settings\007\桌面\装vc代码\1\1Dlg.cpp(146) : error C2228: left of '.cx' must have class/struct/union type
C:\Documents and Settings\007\桌面\装vc代码\1\1Dlg.cpp(147) : error C2228: left of '.cy' must have class/struct/union type
C:\Documents and Settings\007\桌面\装vc代码\1\1Dlg.cpp(217) : error C2228: left of '.cx' must have class/struct/union type
C:\Documents and Settings\007\桌面\装vc代码\1\1Dlg.cpp(217) : error C2228: left of '.cy' must have class/struct/union type
Generating Code...
Error executing cl.exe.1.exe - 11 error(s), 0 warning(s)

解决方案 »

  1.   

    在CMy1Dlg的头文件里加一句 “CSize m_size”,再去掉一句:“void OnDown()”
    编译通过,但程序执行有问题。
      

  2.   

    我怎么编译通不过啊,错是少多了-Configuration: 1 - Win32 Debug--------------------
    Compiling...
    1.cpp
    c:\documents and settings\007\桌面\工作\1\1dlg.h(48) : error C2144: syntax error : missing ';' before type 'int'
    c:\documents and settings\007\桌面\工作\1\1dlg.h(73) : error C2535: 'void __thiscall CMy1Dlg::OnDown(void)' : member function already defined or declared
            c:\documents and settings\007\桌面\工作\1\1dlg.h(36) : see declaration of 'OnDown'
    1Dlg.cpp
    c:\documents and settings\007\桌面\工作\1\1dlg.h(48) : error C2144: syntax error : missing ';' before type 'int'
    c:\documents and settings\007\桌面\工作\1\1dlg.h(73) : error C2535: 'void __thiscall CMy1Dlg::OnDown(void)' : member function already defined or declared
            c:\documents and settings\007\桌面\工作\1\1dlg.h(36) : see declaration of 'OnDown'
    Generating Code...
    Error executing cl.exe.1.exe - 4 error(s), 0 warning(s)