1. BUG:
The program has an inexplicable error. The error location is cview: onclienttodc, ondraw, onpaint, and so on.
There is a message warning: uncaught exception in windowproc (returning 0 ).
2. Conclusion:
GDI object does not have release
3. Code requirements:
The Code contains getdc () but does not call releasedc (CDC * PDC ).
Knowledge point:
1. deletedc corresponds to createdc; releasedc corresponds to getdc
Getdc (): This function releases a device context (DC), freeing it for use by other applications.
If you do not use them in pairs, there will be a DC resource problem. The GDI object will occupy more and more resources. When the number exceeds 10,000, the program will crash.
2. Test Method
Task Manager, "View" menu, select "Select column...", and select "GDI object"
Task Manager, "View" menu, select "select columns", pick up "GDI objects"
Summary:
1. Pay attention to the Methods declared in msdn to be used in pairs.
2. Make good use of test tools. Basic performance tests allow you to make full use of the task manager. Very helpful