I created a simple VC++ 6.0 MFC application, one dialog as a test. The attached snippet is my OnOK() handler. All it does is loop indefinitely calling CreateCompatibleDC() and then DeleteDC.
When I first run the app and check it out in Task Manager, I see it consuming 8,308k of memory. This holds steady (it's not doing anything.) I then click the OK button, and the attached snippet runs. Memory usage grows very rapidly.
Why is this? Does something else need to be done to delete the device context?