Res The GetDC function retrieves a common, class, or private DC depending on the class style specified for the specified window. For common DCs, GetDC assigns default attributes to the DC each time it is retrieved. For class and private DCs, GetDC leaves the previously assigned attributes unchanged. Note that the handle to the DC can only be used by a single thread at any one time.After painting with a common DC, the ReleaseDC function must be called to release the DC. Class and private DCs do not have to be released. ReleaseDC must be called from the same thread that called GetDC. The number of DCs is limited only by available memory. Windows 95/98: There are only 5 common DCs available per thread, thus failure to release a DC can prevent other applications from accessing one.
Windows NT/2000: To get extended error information, call GetLastError. _________ 首先看看是什么错误.After painting with a common DC, the ReleaseDC function must be called to release the DC. ___________ 所有的DC都释放了吗? Windows 95/98: There are only 5 common DCs available per thread __________ 达到这个限制了没有?
所有的DC都释放了吗? There are limited DC's in windows system.
The GetDC function retrieves a common, class, or private DC depending on the class style specified for the specified window. For common DCs, GetDC assigns default attributes to the DC each time it is retrieved. For class and private DCs, GetDC leaves the previously assigned attributes unchanged. Note that the handle to the DC can only be used by a single thread at any one time.After painting with a common DC, the ReleaseDC function must be called to release the DC. Class and private DCs do not have to be released. ReleaseDC must be called from the same thread that called GetDC. The number of DCs is limited only by available memory. Windows 95/98: There are only 5 common DCs available per thread, thus failure to release a DC can prevent other applications from accessing one.
_________
首先看看是什么错误.After painting with a common DC, the ReleaseDC function must be called to release the DC.
___________
所有的DC都释放了吗?
Windows 95/98: There are only 5 common DCs available per thread
__________
达到这个限制了没有?
There are limited DC's in windows system.
我忘了说明一点,我的程序不能正常获取dc的时候就崩溃了,出现严重的内存错误!所以我也不能GetLastError。
同时我觉得超过5个dc的情况也不会出现的。主要是前一次和后一次的操作完全一致。