1

I am facing a problem where I am getting the device context as NULL in OnEraseBkgnd fucntion handler. I have OnEraseBkgnd handler in my custom Tab control class which is inherited from CTabCtrl, I am also getting the same problem in DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) of another custom button control class which is inherited from CButton.

Device Context is getting NULL sporadically and not always. Please let me know if any idea why this device context would have become NULL.

Sannuthi M
  • 11
  • 2
  • I never saw this. Also not allowed by windows. Check you callstack, maybe in an underlying routine you are doing some bogus things. – xMRi Aug 18 '17 at 10:49

0 Answers0