1>------ 已启动生成: 项目: SageMiniGel, 配置: Debug Win32 ------
1>正在编译...
1>WaitProgress.cpp
1>e:\赛智工作项目\sageminigel\sourse\waitprogress.cpp(287) : warning C4482: nonstandard extension used: enum 'Gdiplus::LineCap' used in qualified name
1>e:\赛智工作项目\sageminigel\sourse\waitprogress.cpp(288) : warning C4482: nonstandard extension used: enum 'Gdiplus::LineCap' used in qualified name
1>正在链接...
1>正在嵌入清单...
1>生成日志保存在“file://e:\赛智工作项目\SageMiniGel\temp\2005_Debug\BuildLog.htm”
1>SageMiniGel - 0 个错误,2 个警告
========== 生成: 1 已成功, 0 已失败, 0 最新, 0 已跳过 ==========
其中gdiplus.h文件定义形式如下:
namespace Gdiplus
{
#include "GdiplusEnums.h"
};
其中GdiplusEnums.h文件定义形式如下:
enum LineCap
{
LineCapFlat = 0,
LineCapSquare = 1,
LineCapRound = 2,
LineCapTriangle = 3,
LineCapNoAnchor = 0x10, // corresponds to flat cap
LineCapSquareAnchor = 0x11, // corresponds to square cap
LineCapRoundAnchor = 0x12, // corresponds to round cap
LineCapDiamondAnchor = 0x13, // corresponds to triangle cap
LineCapArrowAnchor = 0x14, // no correspondence
LineCapCustom = 0xff, // custom cap
LineCapAnchorMask = 0xf0 // mask to check for anchor or not.
};
其中,调用代码如下:
myPen.SetStartCap(LineCap::LineCapRound);
myPen.SetEndCap(LineCap::LineCapRound);
解决方案:
myPen.SetStartCap(Gdiplus::LineCapRound);
myPen.SetEndCap(Gdiplus::LineCapRound);
原理:LineCap枚举其实就定义在Gdiplus的命名空间内,在Gdiplus命名空间内调用LineCap的枚举不用使用LineCap::,而Gdiplus命名空间外调用LineCap的枚举不用使用LineCap::,使用Gdiplus::枚举的限定 就Ok了。