M
Mosfet
Hi,
I wanted to test the Loki SmartPtr but I don't know exactly how it works
and reading code with so many templates give me headache.
So here is how I am using it :
SmartPtr<Gdiplus::Bitmap> bmp =
new
Gdiplus::Bitmap(rcClient.Width(),rcClient.Height(),PixelFormat16bppRGB565);
SmartPtr<Gdiplus::Graphics> g = Gdiplus::Graphics::FromImage( bmp );
error C2664: 'Gdiplus::Graphics::FromImage' : cannot convert parameter 1
from 'Loki::SmartPtr<T>' to 'Gdiplus::Image *'
1> with
1> [
1> T=Gdiplus::Bitmap
1> ]
1> No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called
Actually how can I get from my SmartPtr<Gdiplus::Bitmap> the underlying
pointer. I tried to do this :
SmartPtr<Gdiplus::Graphics> g = Gdiplus::Graphics::FromImage(
(Image*)&bmp ); and it compiles but I get a crash when running.
Thanks
I wanted to test the Loki SmartPtr but I don't know exactly how it works
and reading code with so many templates give me headache.
So here is how I am using it :
SmartPtr<Gdiplus::Bitmap> bmp =
new
Gdiplus::Bitmap(rcClient.Width(),rcClient.Height(),PixelFormat16bppRGB565);
SmartPtr<Gdiplus::Graphics> g = Gdiplus::Graphics::FromImage( bmp );
error C2664: 'Gdiplus::Graphics::FromImage' : cannot convert parameter 1
from 'Loki::SmartPtr<T>' to 'Gdiplus::Image *'
1> with
1> [
1> T=Gdiplus::Bitmap
1> ]
1> No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called
Actually how can I get from my SmartPtr<Gdiplus::Bitmap> the underlying
pointer. I tried to do this :
SmartPtr<Gdiplus::Graphics> g = Gdiplus::Graphics::FromImage(
(Image*)&bmp ); and it compiles but I get a crash when running.
Thanks