Should I 'delete' this CDC?
- by Binary Worrier
Folks,
I'm trying to track down an intermittant bug that's showing up on site.
I've a feeling it's in some GDI code I'd to cobble together to get a tally printer working.
I'm connfused over how to delete this CDC, my code looks OK to me, but is this correct.
// Create a device context for printing
CDC* dc = new CDC();
if(! dc->CreateDC(safeDriverName.AsBSTR(), safePrinterName.AsBSTR(), NULL, NULL))
{
throw . . .
}
// as I finish with the CDC
dc->DeleteDC();
delete dc;
Do I need delete dc after dc->DeleteDC();?
Thanks