can't use "new" with gdiplus objects
-
hi everyone... i have this little problem and i hope u can help me with it.. the problem appears when using the following code: Graphics* pGraphics = new Graphics(hdc); the previous code doesn't compile: error C2660: 'Gdiplus::GdiplusBase::operator new' : function does not take 3 parameters
-
hi everyone... i have this little problem and i hope u can help me with it.. the problem appears when using the following code: Graphics* pGraphics = new Graphics(hdc); the previous code doesn't compile: error C2660: 'Gdiplus::GdiplusBase::operator new' : function does not take 3 parameters
Did you miss the
#define new DEBUG_NEW
statement at the top of your .cpp file? To squelch the compiler error, simply undefine thenew
operator prior to includinggdiplus.h
.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
Did you miss the
#define new DEBUG_NEW
statement at the top of your .cpp file? To squelch the compiler error, simply undefine thenew
operator prior to includinggdiplus.h
.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Or you could use
::new
for GDI+ objects. That way you do not loss the DEBUG_NEW functionality in the rest of your code.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!
-
Or you could use
::new
for GDI+ objects. That way you do not loss the DEBUG_NEW functionality in the rest of your code.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!
Doh! Thanks for reminding me of the scope-resolution operator.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
Doh! Thanks for reminding me of the scope-resolution operator.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
i undefined new and everything went OK...but what's the functionality of DEBUG_NEW anyway..
saeedmalas wrote: what's the functionality of DEBUG_NEW anyway It implements the ability of the debugger to be able to track the line number and file name of where any memory leaks were allocated. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_debug_new.asp[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!
-
saeedmalas wrote: what's the functionality of DEBUG_NEW anyway It implements the ability of the debugger to be able to track the line number and file name of where any memory leaks were allocated. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_debug_new.asp[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!
-
I beleave that this will do everything you need. #pragma push_macro("new") #undef new #include #pragma pop_macro("new") Thank You Bo Hunter