Friday, December 28, 2007

Programming Tips: GDI+ in Visual Studio 2005

This is the first mini article of a series where I present tips to solve programming problems that I have faced and have solved either by help from internet resources or research by my own.
An interesting problem that I face a while ago in Visual Studio 2005 was that while using a project with a precompiled header and classes and methods of GDI+ appeared to be hundreds of errors concerning everything that was related to GDI+ and even in header files of the GDI+ library (which was quite unlikely). After searching about the subject in a forum I found that in the precompiled header (stdafx.h) there is a line #define WIN32_LEAN_AND_MEAN which excludes unnecessairy declarations. As it seems it excludes the GDI+ declarations too and that way we cannot use it. Either by deleting this line or by commenting it out the problem is solved.

No comments: