I'm running some legacy code that eventually fails on GetDC(null). It will return NULL with GetLastError() returning 0. The documention I've read says that the culprit is a GDI resource leak somewhere.
Fair enough.

A lot of the code has calls to GetDC() like so:

Code:
    m_hOldBmp = (HBITMAP) ::SelectObject(GetDC(), m_hBmp);

  // and

    m_hBmp = ::CreateDIBSection(GetDC(), (BITMAPINFO*) &bmih,  DIB_RGB_COLORS, NULL,NULL, 0 );
I can't find in the documentation if the DC returned from these GetDC() calls will ever be released. They aren't being released in the code. I've run handle leak profilers and nothing is amiss. However, sure enough, after enough hours, the software will fail and all calls to GetDC() will return NULL.

Is calling GetDC() as the parameter to a method like this good practice? Should something different be done here?