Provides a device context to the font that describes the logical mapping mode.
HRESULT SetHdc(
HDC hdc //Device context handle
);
The method supports the standard return value E_INVALIDARG, as well as the following:
The logical mapping mode affects the font's internal computation of its point size so that when the caller asks for a font handle by calling IFont::GetHfont, the font is already properly scaled to the device context.
The caller retains ownership of this device context which must remain valid for the lifetime of the font object. Thus, the device context passed should be a memory device context (from the Win32 function CreateCompatibleDC) and not a screen device context (from CreateDC, GetDC, or BeginPaint) because screen device contexts are a limited system resource.
Windows NT: Use version 4.0 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in ocidl.h.