文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Visual C++ 时尚编程百例013(CRect类)

Visual C++ 时尚编程百例013(CRect类)

时间:2011-03-09  来源:大气象

CRect类
在头文件中添加CRect r;
#define RED RGB(255,0,0)
#define GREEN RGB(0,255,0)
#define BLUE RGB(0,0,255)
#define BLACK RGB(0,0,0)
在源文件中修改OnDraw()
GetClientRect(r);
if(r.right>750&&r.right<1000||r.bottom>750&&r.bottom<1000)
 pDC->FillSolidRect(r,RED);
else if(r.right>500&&r.right<750||r.bottom>500&&r.bottom<750)
 pDC->FillSolidRect(r,GREEN);
else if(r.right<500||r.bottom<500)
 pDC->FillSolidRect(r,BLUE);
else
 pDC->FillSolidRect(r,BLACK);

错误 1 error C2143: 语法错误 : 缺少“)”(在“;”的前面)
#define RED RGB(255,0,0)
#define GREEN RGB(0,255,0)
这里如果后面加分号就会提示错误。小细节。
参考超前引用:
http://www.vckbase.com/bbs/prime/viewprime.asp?id=431
http://blog.vckbase.com/arong/archive/2004/05/28/294.aspx

相关阅读 更多 +
排行榜 更多 +
别惹神枪手安卓版

别惹神枪手安卓版

冒险解谜 下载
坦克战争世界

坦克战争世界

模拟经营 下载
丛林反击战

丛林反击战

飞行射击 下载