CreateCompatibleBitmap and mem allocation
-
Hello everyone I am using CreateCompatibleBitmap to create bitmaps of my list of worksheets. The problem is, when I hit around 20 bitmaps in a loop, the CreateCompatibleBitmap call begins to fail. I have traced into the MFC function calls and I discovered that the memory allocation on the HEAP has reached its limit for creating more resources. Has anybody ever seen this before?? If not, does anybody have any suggestions?? Thank you for you help IGeorgeI George W Software Developer www.zsystems.ca
-
Hello everyone I am using CreateCompatibleBitmap to create bitmaps of my list of worksheets. The problem is, when I hit around 20 bitmaps in a loop, the CreateCompatibleBitmap call begins to fail. I have traced into the MFC function calls and I discovered that the memory allocation on the HEAP has reached its limit for creating more resources. Has anybody ever seen this before?? If not, does anybody have any suggestions?? Thank you for you help IGeorgeI George W Software Developer www.zsystems.ca
I've seen it when the bitmaps are very large, or leaked. I would try to structure the code so that I didn't need more than one bitmap at any given time, making sure to properly deselect them from any
CDC
, if appropriate. And, of course, callingDeleteObject
, either directly or by having the dtor of theCBitmap
invoked. -
Hello everyone I am using CreateCompatibleBitmap to create bitmaps of my list of worksheets. The problem is, when I hit around 20 bitmaps in a loop, the CreateCompatibleBitmap call begins to fail. I have traced into the MFC function calls and I discovered that the memory allocation on the HEAP has reached its limit for creating more resources. Has anybody ever seen this before?? If not, does anybody have any suggestions?? Thank you for you help IGeorgeI George W Software Developer www.zsystems.ca
How big are the bitmap sizes? I used CreateCompatibleBitmap often in code I work with, and have not come across this issue. I very interested in what the bitmap sizes are, that cause the heap to fill up. thanx