Andreas Nicolai schrieb:
> Hi there,
>
> after creating a font
>
> CFont myFont;
> myFont.CreatePointFont(...);
>
> and setting a font to the device context with
>
> CFont * oldFont = dc.SelectObject(&myFont);
>
> and restoring it with
>
> dc.SelectObject(oldFont);
>
> do I really have to delete the object with
>
> myFont.DeleteObject();
>
> as it is written in the MFC docs?
>
> If that is really necessary it has been forgotten many times in the
> MyGraph.cpp.
>
> Bye,
> Andreas
>
If you dont delete it, the Fonts stay in memory and you have memory
leaks. Easiest way for never forget it is using a small C++ class
wrapper where the destructor automatically deletes the font after
selecting the old font.
best regards
Hans-Werner
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Wed Oct 10 08:45:30 2007