Click to See Complete Forum and Search --> : GDI+ new operator


The Unlord
September 2nd, 2005, 08:19 AM
Hi

I'm having problems with the new operator on some GDI+ objects.
I want to create a CachedBitmap via a pointer. But if I try

m_pBmpBack = new CachedBitmap(&Bmp, m_pGraphics);

I get compiler error C2660
'Gdiplus::GdiplusBase::operator new' : function does not take 3 arguments

Somehow, the compiler doesn't seem to take the constructor of CachedBitmap, but sticks to the base class' constructor GdiplusBase, which only takes a size parameter.

Then I downloaded a sample, that does exactly the same, but lo and behold, it compiles without any fuss.

What am I missing here?

thx a bunch!

g_gili
September 2nd, 2005, 03:38 PM
use like this:


m_pBmpBack =::new CachedBitmap(&Bmp, m_pGraphics);

for more answers look at this link (http://www.codeproject.com/vcpp/gdiplus/gdiplusspeed.asp?df=100&tid=81095&forumid=2466&select=81095#xx81095xx) at the faq(at the bottom of this page)

The Unlord
September 6th, 2005, 07:56 AM
Thx, mate, hadn't thought of that!
Works great now.