Resources burn up!
Posted on 2003-03-24
I'm working with:
CreateCompatibleDC, CreateCompatibleBitmap, DeleteObject and DeleteDC.
I have a re-enterable routine that will size the Compatible Bitmap as needed.
The problem is:
if Bitmaphandle<>0 then DeleteObject Bitmaphandle ' Previous bitmap
CreateCompatibleBitmap .... 'build bitmap and store in Bitmaphandle
Doing this, repeatively (when size changes happen), causes exhaustive resource burning (in the high percentage ranges, like almost 10% each time).
There is only one hDC being used, it's not deleted, each DeleteObject returns 1 (success), so I'm at a large loss as to why this is happening right now, because if I delete the object, the memory should be freed up, but it isn't (until the program exits, which is bad). Is there a way I can get the system to do this FREE up when I need it to?
I must be over looking an API function for GC. It just makes no sense that I need to ask for it. Getting past this, will allow me to finish a calendar stamping function class (that lets you stamp a calendar onto a bitmap).