Sign in to follow this  

Having to HDC hDC = GetDC(hWnd)

This topic is 4299 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Language: C/C++/Win32 OS: Windows XP IDE: Visual C++.NET 2005 Currently I have just completed making my text blitter class that works for any alphabet bmp I give it, and a double buffer class that works good, but the problem is that each of them have a HDC that use GetDC(). Is it okay if I have to HDC's that have the windows client area device context if they both are managed properly and cleaned up fine? I wanted to ask this before I moved on with any other coding. Thank you for the replies. Edit: I just solved my problem of having two hdc's that both pointed to the window client area. But I'm still wanting to know if having to main hdc's that have the window client area (where every thing is shown to the user) is okay?

Share this post


Link to post
Share on other sites
It can't be bad, unless you don't manage them correctly. HDC are still a limited system resource (less limited than before, but still).

I don't undersatnd: why don't you use the same HDC? After all, they have the same target, so they don't need to be different.

Regards,

Share this post


Link to post
Share on other sites
HDC's are a limited system resource in the sense that you can only have a few thousand per-process... On NT/XP/etc anyway, I don't remember if Win9X inherited the old severe limitations that Win16 had.

I really have no clue what the OP is trying to ask. In general though you really shouldn't need to have more than one cached DC.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anon Mike
HDC's are a limited system resource in the sense that you can only have a few thousand per-process... On NT/XP/etc anyway, I don't remember if Win9X inherited the old severe limitations that Win16 had.

I really have no clue what the OP is trying to ask. In general though you really shouldn't need to have more than one cached DC.


A few thousand per process can be very limited if you have a resource leak :)

Share this post


Link to post
Share on other sites

This topic is 4299 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this