You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Abstract DeviceContextSafeHandle with concrete DeleteDCSafeHandle and ReleaseDCSafeHandle #111
Could CsWin32 do something like this? I like declaring Gdi32 methods to use an abstract DeviceContextSafeHandle so that not just any SafeHandle can be passed, but then I have make CreateCompatibleDC return DeleteDCSafeHandle and GetDC return ReleaseDCSafeHandle. (I call mine CreatedContextSafeHandle and WindowDeviceContextSafeHandle).
The main benefit for me is that when passing WindowDeviceContextSafeHandle around between my own methods, I know it's always valid to access the HWnd property.
I've also preferred a more strongly-typed BitmapSafeHandle option so that there is some type safety for things like int GetObject(BitmapSafeHandle h, int c, out BITMAP pv);. I have it inherit from a virtual GdiObjectSafeHandle class.
Activity
jnm2 commentedon Feb 17, 2021
I've also preferred a more strongly-typed
BitmapSafeHandleoption so that there is some type safety for things likeint GetObject(BitmapSafeHandle h, int c, out BITMAP pv);. I have it inherit from a virtualGdiObjectSafeHandleclass.AArnott commentedon Feb 17, 2021
Per the design in #9, we won't be taking any derived type of SafeHandle as inputs any more anyway. Only SafeHandle itself.
Enable Component Governance to PR builds (#111)