Images in MFC are created in the OnDraw function. We have to give "pDC->m_hDC" as the parameter if we want to draw an image...
The problem is that we can get pDC only in our OnDraw function. Now if we want to draw images outside that OnDraw then we need to create a pointer to "CDC" type to get "m_hDC" from it.
Some people said use this code:
CDC * dc = getDC();
But it says getDC() is undefined. What should I do?
The main point is that I want an initialized pointer to CDC in order to use it anywhere.