public static SafeDC CreateDC(string deviceName) { SafeDC dc = null; try { // Should this really be on the driver parameter? dc = NativeMethods.CreateDC(deviceName, null, IntPtr.Zero, IntPtr.Zero); } finally { if (dc != null) { dc._created = true; } } if (dc.IsInvalid) { dc.Dispose(); throw new SystemException("Unable to create a device context from the specified device information."); } return(dc); }
public static Standard.SafeDC CreateDC(string deviceName) { Standard.SafeDC edc = null; try { edc = NativeMethods.CreateDC(deviceName, null, IntPtr.Zero, IntPtr.Zero); } finally { if (edc != null) { edc._created = true; } } if (edc.IsInvalid) { edc.Dispose(); throw new SystemException("Unable to create a device context from the specified device information."); } return(edc); }