Visual C++ 6.0 支持gdi+

来源:互联网 发布:中国停止登月计划 知乎 编辑:程序博客网 时间:2024/06/07 12:14

VC6作为经典版本C++仍在给各位提供学习便利,但无奈太老了,原装版本不支持gdi+编程,设置如下,作为参照

 

  1. 下载最后支持VC6的SDK开发包

    For Server2003    3790.0 RTM:    Size (bytes):    342,000,000    Last Updated:    February 2003
    For XPSP2           2600.2180 RTM:      Size (bytes):    266,000,000    Last Updated:    August 2004
    上面两个任选一个解压缩安装一下,并在VC中设置目录。上面两个都内置gdi+编程库。我选择的是 for XP SP2

  2. stdafx.h中 加入 #include <gdiplus.h>  ,注意加在靠后位置否则编译出错
    再加入 #pragma comment(lib, "gdiplus.lib") 

    #include <atlbase.h>#include <atlapp.h>extern CAppModule _Module;#include <atlwin.h>#include <atlframe.h>#include <atlctrls.h>#include <atldlgs.h>#include <atlctrlw.h>#include <atlcrack.h>#include <atlgdi.h>#include <atlmisc.h>#include <gdiplus.h> //主要这个文件要要添加在靠后位置,否则编译出错#pragma comment(lib, "gdiplus.lib")  


  3. 在需要gdi+函数的模块,加入 using namespace Gdiplus;

  4. 初始化一下gdi+ 环境,就可使用。

以上环境在vc6 WTL 7.1 编译通过

原创粉丝点击