请教各位帮忙调试一下:http://www.codeguru.com/gdi/jt2draw.html这个例程,有关GDI+的?

lifeequation 2003-04-03 10:09:47
我是win2000,vc6。0,我在vc里面的tool-》options-》directories下包含了bcg的头文件,和GDI+的头文件和库文件,并在可执行文件的目录下放了它们的dll,
在stdafx。h中如下设置时:
#if !defined(AFX_STDAFX_H__64222BB7_A5DC_11D3_B4DC_00A0C995EA3D__INCLUDED_)
#define AFX_STDAFX_H__64222BB7_A5DC_11D3_B4DC_00A0C995EA3D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxole.h> // MFC OLE classes
#include <afxodlgs.h> // MFC OLE dialog classes
#include <afxdisp.h> // MFC Automation classes
#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

#if _MSC_VER >= 1300
#define WPD_CHARFORMAT CHARFORMAT2
#define WPD_PARAFORMAT PARAFORMAT2
#else
#define WPD_CHARFORMAT CHARFORMAT
#define WPD_PARAFORMAT PARAFORMAT
#endif

struct CCharFormat : public WPD_CHARFORMAT
{
CCharFormat() {cbSize = sizeof(WPD_CHARFORMAT);}
BOOL operator==(CCharFormat& cf);
};

typedef struct {
COLORREF crColour;
TCHAR *szName;
} ColourTableEntry;

#include <afxtempl.h> // drawobj.h uses collection class templates


#include "include\\bcgcb.h"
//#include <bcgcb.h>
#include "includes\\GdiPlus.h"

//#include <gdiplus.h>

// GdiPlus -- Added by the GdiPlus macro
using namespace Gdiplus;
#pragma comment (lib, "Gdiplus.lib")

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__64222BB7_A5DC_11D3_B4DC_00A0C995EA3D__INCLUDED_)
会出现如下的编译错误:

:\jt2draw\draw\includes\\gdiplusinit.h(32) : error C2065: 'ULONG_PTR' : undeclared identifier
f:\jt2draw\draw\includes\\gdiplusinit.h(32) : error C2065: 'token' : undeclared identifier
f:\jt2draw\draw\includes\\gdiplusinit.h(32) : error C2165: 'left-side modifier' : cannot modify pointers to data
f:\jt2draw\draw\includes\\gdiplusinit.h(32) : error C2071: 'NotificationHookProc' : illegal storage class
f:\jt2draw\draw\includes\\gdiplusinit.h(33) : error C2146: syntax error : missing ')' before identifier 'token'
f:\jt2draw\draw\includes\\gdiplusinit.h(33) : error C2165: 'left-side modifier' : cannot modify pointers to data
f:\jt2draw\draw\includes\\gdiplusinit.h(33) : error C2071: 'NotificationUnhookProc' : illegal storage class
f:\jt2draw\draw\includes\\gdiplusinit.h(33) : error C2059: syntax error : ')'
f:\jt2draw\draw\includes\\gdiplusinit.h(86) : error C2059: syntax error : 'const'
f:\jt2draw\draw\includes\\gdiplusinit.h(95) : error C2146: syntax error : missing ')' before identifier 'token'
f:\jt2draw\draw\includes\\gdiplusinit.h(95) : warning C4229: anachronism used : modifiers on data are ignored
f:\jt2draw\draw\includes\\gdiplusinit.h(95) : error C2182: 'GdiplusShutdown' : illegal use of type 'void'
f:\jt2draw\draw\includes\\gdiplusinit.h(95) : error C2059: syntax error : ')'
但是:如果把
#include "includes\\GdiPlus.h"
// GdiPlus -- Added by the GdiPlus macro
using namespace Gdiplus;
#pragma comment (lib, "Gdiplus.lib")
放在#include <afxwin.h> 前面,未定义的编译错误少了很多,但是则会出现如下的错误,
f:\jt2draw\draw\includes\\gdiplusenums.h(28) : error C2146: syntax error : missing ';' before identifier 'GraphicsState'
f:\jt2draw\draw\includes\\gdiplusenums.h(28) : fatal error C1004: unexpected end of file found
这两个错误,请问各位这是怎么回事啊?我想是不是我在stdafx。h下出现了什么问题?
在gdiplusenums.h中的GraphicsState的定义是这样的:
\**************************************************************************/

#ifndef _GDIPLUSENUMS_H
#define _GDIPLUSENUMS_H

//--------------------------------------------------------------------------
// Default bezier flattening tolerance in device pixels.
//--------------------------------------------------------------------------

const float FlatnessDefault = 1.0f/4.0f;

//--------------------------------------------------------------------------
// Graphics and Container State cookies
//--------------------------------------------------------------------------

typedef UINT GraphicsState;
typedef UINT GraphicsContainer;

//--------------------------------------------------------------------------
// Fill mode constants
//--------------------------------------------------------------------------

enum FillMode
{
FillModeAlternate, // 0
FillModeWinding // 1
};

请问这是怎么回事?谢谢!
...全文
91 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
harry202 2003-04-04
  • 打赏
  • 举报
回复
将include设置中,sdk目录移到mfc上面即可,产生原因是gdiplus用的是SDK里的ULONG定义,和MFC的冲突。
fingerfox 2003-04-03
  • 打赏
  • 举报
回复
不要什么补丁。
fingerfox 2003-04-03
  • 打赏
  • 举报
回复
在#include "gdiplus.h"之前加上
#define ULONG_PTR void*
lifeequation 2003-04-03
  • 打赏
  • 举报
回复
不知哪里有下载啊?告诉一下网址好吗?
UDX协议 2003-04-03
  • 打赏
  • 举报
回复
加vc sp5
vc的补丁
lifeequation 2003-04-03
  • 打赏
  • 举报
回复
我在线等待,怎么没有人关注一下???
lifeequation 2003-04-03
  • 打赏
  • 举报
回复
狐狸兄弟,你的方法我试过了,在stdafx.h中我在在#include "gdiplus.h"之前加上
之前加了#define ULONG_PTR void*之后,编译仍旧是这两个错误:
f:\jt2draw\draw\includes\\gdiplusenums.h(28) : error C2146: syntax error : missing ';' before identifier 'GraphicsState'
f:\jt2draw\draw\includes\\gdiplusenums.h(28) : fatal error C1004: unexpected end of file found
不知为何?

19,468

社区成员

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

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