If the function succeeds, the return value is nonzero.
From the GDI Black Book: remember, use the ReleaseDC function only for a display device context that was retrieved from the GDI device-context cache. After you"re done with the memory device context, you must free it by using the DeleteDC function.
- use ReleaseDC for forms (the hwnd used as the first parameter)
- use DeleteDC for memory device contexts (e.g. CreateCompatibleDC)