Article ID: 317799 - Last Review: February 12, 2007 - Revision: 2.1 PRB: Microsoft Foundation Classes DEBUG_NEW Does Not Work with GDI+
This article was previously published under Q317799 SYMPTOMS
When you build a debug version of a Microsoft Foundation Classes (MFC) application that uses GDI+, you may receive an error message that resembles the following:
error C2660: 'Gdiplus::GdiplusBase::operator new' : function does not take 3 parameters
CAUSE
In debug builds, MFC defines a preprocessor macro that expands the new operator to an overloaded new operator that takes two extra parameters. The extra parameters are the source file name and code line number. MFC can use this information to report memory leaks to the programmer when in debug mode. This works for MFC classes because MFC provides overloads for new that accept the extra parameters. However, because this expansion is done by the preprocessor, it affects all usage of the new operator. If any non-MFC classes are used in the project, their new operator is also expanded, even if no suitable overload of new is available in that class. This is what happens in GDI+, and as a result, you receive a compile-time error message. WORKAROUND
To work around this problem, choose one of the following methods:
STATUSThis behavior is by design. | Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top
