I need a method to replace the MFC CDC::GetSafeHdc() method used in existing code given CDC*?
Thanks for your comment. I'll add a GetDC method to CDC for the next version of Win32++.
In the meantime, to get the HDC from a CDC you can use:
HDC SomeHDC = MyDC; // Where MyDC is a CDC object.
This works because of operator overloading.
If instead you have a pointer to a CDC object, you can dereference it.
HDC SomeHDC = *pMyDC; // where pMyDC is a CDC pointer
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.