| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 931 人关注过本帖
标题:dc.Arc(&rect,rect.TopLeft,rect.BottomRight) 错在哪了?
只看楼主 加入收藏
andyandy
Rank: 2
等 级:论坛游民
威 望:1
帖 子:108
专家分:94
注 册:2009-4-28
结帖率:100%
收藏
已结贴  问题点数:13 回复次数:5 
dc.Arc(&rect,rect.TopLeft,rect.BottomRight) 错在哪了?
这段程序的最后一句报错——
    CRect rect;
    GetDlgItem(IDC_LIST2)->GetWindowRect(&rect);
    ScreenToClient(&rect);
    CClientDC dc(this);
    dc.Arc(&rect,rect.TopLeft,rect.BottomRight);

error C2664: 'int __thiscall CDC::Arc const struct tagRECT *,struct tagPOINT,struct tagPOINT)' :
cannot convert parameter 2 from 'const class CPoint &void) const' to 'struct tagPOINT'
        No constructor could take the source type, or constructor overload resolution was ambiguous


[ 本帖最后由 andyandy 于 2011-5-22 16:08 编辑 ]
搜索更多相关主题的帖子: resolution convert cannot source 
2011-05-22 16:02
红色警戒
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:19
帖 子:444
专家分:2967
注 册:2005-11-20
收藏
得分:9 
参数类型不一致

2011-05-22 16:06
andyandy
Rank: 2
等 级:论坛游民
威 望:1
帖 子:108
专家分:94
注 册:2009-4-28
收藏
得分:0 
回复 2楼 红色警戒
大侠,说详细点好吗?
能给个方法吗?
2011-05-22 16:23
红色警戒
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:19
帖 子:444
专家分:2967
注 册:2005-11-20
收藏
得分:0 
dc.Arc(&rect,rect.TopLeft,rect.BottomRight);
这儿参数不对,参数类型可参考MSDN

2011-05-22 17:32
andyandy
Rank: 2
等 级:论坛游民
威 望:1
帖 子:108
专家分:94
注 册:2009-4-28
收藏
得分:0 
已解决。改成——
dc.Arc(&rect,rect.TopLeft(),rect.BottomRight());
即可。
只是为什么要加这个空括号?
2011-05-22 21:32
andyandy
Rank: 2
等 级:论坛游民
威 望:1
帖 子:108
专家分:94
注 册:2009-4-28
收藏
得分:0 
明白了。
TopLeft和BottomRight均为函数,因此必须。。。。。。
2011-05-22 21:45
快速回复:dc.Arc(&rect,rect.TopLeft,rect.BottomRight) 错在哪了?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015114 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved