首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

gdi+初始化字体失误

2013-09-28 
gdi+初始化字体出错FontFamilyfontFamily(LTimes New Roman)Fontfont(&fontFamily, 11, FontStyleRegul

gdi+初始化字体出错


FontFamily  fontFamily(L"Times New Roman");
Font        font(&fontFamily, 11, FontStyleRegular, UnitPixel);

完全是按照MSDN例程里面写的,但是仍然提示:

错误 5 error C2872: “Font”: 不明确的符号f:\mfc类\gditest2\gditest2\gdiop.cpp136
错误 6 error C2259: “Font”: 不能实例化抽象类f:\mfc类\gditest2\gditest2\gdiop.cpp136
错误 7 error C2661: “Font::Font”: 没有重载函数接受 4 个参数f:\mfc类\gditest2\gditest2\gdiop.cpp136
---------------------------------------------------------
用的是vs 2008版本的,是不是名字空间之类的有冲突?
[解决办法]
using namespace Gdiplus;
or
Gdiplus::Font
Gdiplus::FontFamily

热点排行