Rose Mary
April 15th, 1999, 09:58 AM
Hello, All.
For a CFont object that I create, I need to destroy the object when I am done using it. Otherwise will cause a space wasted. But what is the right way to destroy the object ?
please see the following case:
CFont NewFont;
CFont *pOldFont;
NewFont.CreateFont();
pOldFont = pDC->SelectObject(&NewFont);
....
pDC->SelectObject(pOldFont);
After I select pOldFont back, Do I need to delete the NewFont and How to ? or the destructor of NewFont will take care of this thing ?
Thanks!
For a CFont object that I create, I need to destroy the object when I am done using it. Otherwise will cause a space wasted. But what is the right way to destroy the object ?
please see the following case:
CFont NewFont;
CFont *pOldFont;
NewFont.CreateFont();
pOldFont = pDC->SelectObject(&NewFont);
....
pDC->SelectObject(pOldFont);
After I select pOldFont back, Do I need to delete the NewFont and How to ? or the destructor of NewFont will take care of this thing ?
Thanks!