Our application is failing on one specific user\'s computer with ERROR_NOT_ENOUGH_MEMORY (\"Not enough storage is available to process this command\").
My answer may be a little bit late but, from my late experience with that same issue, doing all the tests, going step by step, creating DC, releasing it, using DIBSection instead of CompatibleBitmap, using leak GDI/Memory tools, etc.
In the end (LOL) I found that:
I was switching the priority of these two calls, then the whole problem was fixed.
DeleteDC(hdc); //do it first (always before deleting objects)
DeleteObject(obj);