VC++6.0 GDI使用问题?

w1984721 2007-01-15 04:03:53
我把DLL,LIB和.h文件都加进去了,我什么都还没写呢,错就出了 :
G:\VC98\INCLUDE\GdiplusInit.h(39) : error C2065: 'ULONG_PTR' : undeclared identifier
G:\VC98\INCLUDE\GdiplusInit.h(39) : error C2065: 'token' : undeclared identifier
..............
..............
DLL,LIB和.h文件都加的位置都是对的?
如何解决?
...全文
442 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
fredhurui 2008-04-22
  • 打赏
  • 举报
回复
我也遇到这样的问题啊,解决不了啊
w1984721 2007-01-17
  • 打赏
  • 举报
回复
大哥!还是有错!
G:\VC98\INCLUDE\GdiplusEnums.h(29) : error C2146: syntax error : missing ';' before identifier 'GraphicsState'
G:\VC98\INCLUDE\GdiplusEnums.h(29) : fatal error C1004: unexpected end of file found

w1984721 2007-01-16
  • 打赏
  • 举报
回复
UP
aj3423 2007-01-16
  • 打赏
  • 举报
回复
这个是GDI+不是GDI
要在程序开头加上

#define _WIN32_WINNT 0x0502

#define UNICODE
#ifndef ULONG_PTR
#define ULONG_PTR unsigned long*
#endif
#include <gdiplus.h>
using namespace Gdiplus;
#pragma comment(lib, "gdiplus.lib") //link gdiplus.lib

GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;

然后在程序使用GDI+之前要
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);

程序结束时候
GdiplusShutdown(gdiplusToken);
w1984721 2007-01-15
  • 打赏
  • 举报
回复
我改变了库目录的先后顺:
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers

#include <GdiPlus.h>
using namespace Gdiplus;
#pragma comment(lib,"gdiplus.lib")

#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
但是又出现了下面错误:
G:\VC98\INCLUDE\GdiplusEnums.h(29) : error C2146: syntax error : missing ';' before identifier 'GraphicsState'
G:\VC98\INCLUDE\GdiplusEnums.h(29) : fatal error C1004: unexpected end of file found
guogangj 2007-01-15
  • 打赏
  • 举报
回复
这通常是库冲突引起的,检查程序本身是没用的,试图改变一下库目录的先后顺序,包括头文件目录的先后顺序,试试看。

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧