Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Hints to get GDI+ running

0.00/5 (No votes)
24 May 2002 1  
How to avoid compiler-errors and problems with the DLL.

Introduction

First, many thanks to everybody who are contributing to this great community. And of course, special thanks to all the people behind the scenes of CodeProject.

During my first steps with GDI+, I had several problems. Trying to get some advice, I realized, not to be the only one having those compiler-errors and problems with the DLL.

So, here is how I got it up and running.

What to do

I downloaded the Microsoft SDK (November 01 version) which includes GDI+. Because it's a quite huge package, I posted the necessary files in this article, but don't blame me, I never tried it this way. I just installed SDK and took the GDI+ files out of the appropriate folders.

Thanks to Christian Graus, see his article "Starting with GDI+" to get information about initialization in code.

To avoid compiler-errors, make sure that #include <gdiplus.h> is declared in stdafx.h after the standard includes such as #include <afxwin.h>, #include <afxext.h>, #include <afxdisp.h>, #include <afxdtctl.h> etc., so that all declarations are existing when gdiplus.h is parsed.

If the GDI+ include files and .lib are not in the appropriate folders of VC++, set the path to those folders via tools/options and the tab "folders".

The .dll:

GdiPlus.dll is provided with WinXP only.

All other Win-OSs need the one provided with the zip-file above. Don't copy it to the System-folder, instead put it in your app's private folder, the one which also contains the EXE. E.g., the Release or Debug folder of your project during development.

Of course, you also have to name the GdiPlus.lib-include-library under project/settings/linker.

That's all, now it should work fine.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here