How to enable GDI + 1.1 instead of 1.0 in an MFC project?

I can not use the GDI + 1.1 classes in the VS2012 MFC C ++ project (on Win7). Classes Image, Bitmap, Graphics works fine, but when I try to declare an object of class Blur (or other classes v1.1), I get error C2065: ‘Blur’: undeclared identifier. I tried to define GDIPVER(in stdafx.h) like this

#define GDIPVER 0x0110 //also I get the warning C4005: 'GDIPVER' : macro redefinition
#include <gdiplus.h>
#pragma comment (lib,"Gdiplus.lib")

but that will not work.

How to enable GDI + 1.1 instead of 1.0?

+4
source share
1 answer

For some time I struggled with a similar problem in one project. For me, my precompiled header has the following:

#define GDIPVER     0x0110  // Use more advanced GDI+ features

#include "gdiplus.h". .cpp, GDI+. GDI + , GDI + . , , , gdiplus.h, GDIPVER. , , C/++ > /showIncludes, gdiplus.h , .

, , 1.1, . .cpp :

// Update Manifest
// cf: http://blogs.msdn.com/b/oldnewthing/archive/2007/05/31/2995284.aspx
//
// We use features from GDI+ v1.1 which is new as of Windows Vista. There is no redistributable for Windows XP.
// This adds information to the .exe manifest to force GDI+ 1.1 version of gdiplus.dll to be loaded on Vista
// without this, Vista defaults to loading version 1.0 and our application will fail to launch with missing entry points.
#if 64BIT_BUILD
#pragma comment(linker, "\"/manifestdependency:type='Win32' name='Microsoft.Windows.GdiPlus' version='1.1.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker, "\"/manifestdependency:type='Win32' name='Microsoft.Windows.GdiPlus' version='1.1.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
+2
source

All Articles