-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetDC returns HDC but it should return a SafeHandle that calls ReleaseDC #209
Comments
Now, you wanted to see |
Your proposal for handling the oddity of HDC requiring two values to release seems reasonable. That's a lot of customization, but handling this at all (rather than giving up and just generating HDC APIs) will require at least some of it. |
@AArnott Now that I know how templates work, do you mind if I add one for Then to make this useful, can we hardcode the knowledge that |
The metadata bug was fixed ages ago (Mar 16). It already indicates that GetDC returns a |
I would also really love to have a public HWnd property on the safe handle. It should be stored in the safe handle anyway in order to call ReleaseDC, and it's also very useful in cases like this:
The current workaround is to say
new ReleaseDCSafeHandle(hwnd, PInvoke.GetDC(hwnd))
instead ofPInvoke.GetDC(hwnd)
:The text was updated successfully, but these errors were encountered: