Crash using PDFDCEX and freeing the CDC object.

6 views
Skip to first unread message

Ryan

unread,
Jan 9, 2017, 7:53:01 PM1/9/17
to PDFTron PDFNet SDK
Question:

I get a crash using PDFDCEX when I call DeleteDC.

PDFDCEX pdfDc;
CDC pDC
;
pDC
.m_hDC = pDC.m_hAttribDC = pdfDc.Begin(*pdfDoc, Point( 8.5, 11 ) );
CDC tempDC
;
tempDC
.CreateCompatibleDC(&pDC);
// ...
pdfDc
.End();
pDC
.DeleteDC();

Answer:

The HDC object returned by PDFDCEX::Begin is owned by the instance. Clients should not delete the object themselves. This occurs in the call to PDFDCEX::End


Reply all
Reply to author
Forward
0 new messages