Hello,
I use the CreateFont/DeleteObject functions to load/create and release a customer font in my Win32 Application.
The DeleteObject correctly...
CreateFont / DeleteObject leaves font file locked on application exit
I use the CreateFont/DeleteObject functions to load/create and release a customer font in my Win32 Application.
Code:
hFont = CreateFont(fontHeight, 0, 0, 0, 0, 0, 0, 0, OEM_CHARSET, 0, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FIXED_PITCH, szFontName); ... if (hFont != NULL) { BOOL bResult = DeleteObject(hFont); hFont = NULL; if (!bResult) { throw new std::runtime_error("Cannot delete font"); } }
CreateFont / DeleteObject leaves font file locked on application exit