Troubleshooting ERROR_NOT_ENOUGH_MEMORY

后端 未结 4 971
孤城傲影
孤城傲影 2021-01-03 03:32

Our application is failing on one specific user\'s computer with ERROR_NOT_ENOUGH_MEMORY (\"Not enough storage is available to process this command\").

4条回答
  •  旧巷少年郎
    2021-01-03 04:30

    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);
    

提交回复
热议问题