请教各位帮忙调试一下:http://www.codeguru.com/gdi/jt2draw.html这个例程,有关GDI+的?
我是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
};
请问这是怎么回事?谢谢!