0

I have been searching about that class, but it seems to me that its not completely clear to me.

Does that class actually is used for painting, or it also storing the object?

ezra
  • 11
  • 2
  • 2
    `CPaintDC`, just like `CDC`, stores and manages a device context, referenced through an `HDC`. The only difference is, that `CPaintDC` calls `BeginPaint()` and `EndPaint()` during construction and destruction, respectively. The question you asked sounds a lot, like you do not understand the role of MFC at all. Ignoring the framework part, it is a resource management wrapper around the raw Windows API. – IInspectable Mar 13 '18 at 14:32
  • 1
    This is explained under the [Device Contexts](https://learn.microsoft.com/en-us/cpp/mfc/device-contexts) topic. In order to understand that document, you're going to have to get a firm grasp on the Windows API first, specficially [Device Contexts](https://msdn.microsoft.com/en-us/library/dd183553.aspx). If that doesn't help, consider getting a good book, e.g. Petzold's [Programming Windows®](https://www.amazon.com/dp/157231995X). – IInspectable Mar 13 '18 at 14:36
  • In case you don't already know, you should also learn about [RAII](https://stackoverflow.com/q/2321511/7571258). It is essential for understanding in general, how classes like `CPaintDC` manage their associated resources. – zett42 Mar 13 '18 at 17:27

0 Answers0