Hi
I have global variables :
CDC g_dc;
CBitmap g_bmp;

both of these are deleted and recreated in OnSize
Code:
   
   ...
    
    g_bmp.DeleteObject();  
    g_dc.DeleteDC();

    g_dc.CreateCompatibleDC(&ScreenDC);
    g_bmp.CreateCompatibleDC(&g_dc, newWidth, newHeight); 
   
    ...
the resources don't seem to be freed correctly, because after
resizing the window a few times, the application cannot create a bitmap anymore using CreateCompatibleBitmap(..)

what can i do to fully free the resources?

thanks

awni