|
-
Jul 8th, 2001, 10:48 AM
#2
Lively Member
Order is a very important thing when using the GDI32 API.
You don't need to call the "ReleaseDC" in the example you showed. You should just call "DeleteDC".
ReleaseDC is generally used when you grab a window's or control's DC using the "GetDC" function (hence the inclusion of the hWnd argument). When you call ReleaseDC, my understanding is that you are giving ownership of the device context back to its control.
Since you are creating a new one, you should just delete it. By releasing the DC first, you may make it impossible to delete the DC in the subsequent statement.
I could be wrong, but thats my 2 cents.
-Hand out
Visit EliteVB for slimy subclassing tricks and GDI32 goodness.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|