Andreas Hiltner
2013-03-11 14:45:39 UTC
Did anyone notice a crash or non-standard beahvior when calling EnumFontFamiliesEx()?
My code works fine on Windows 7, Vista and before, but crashes on Windows 8 or just calls the callback-function just once.
The debugger tells me it's a corrupt heap, but the code is the same as before.
"(...)
LPLOGFONT lf = (LPLOGFONT) malloc (sizeof(*lf));
memset(lf, '\0', sizeof(*lf));
lf->lfFaceName = '\0';
lf->lfCharSet = DEFAULT_CHARSET;
HRESULT hr;
HDC hdc = GetDC(0);
hr = EnumFontFamiliesEx(hdc, lf, fontProc, 0, 0);
(...)"
fontProc is defined as EnumFontFamExProc and returns 1 to continue the enumeration.
Any comments?
My code works fine on Windows 7, Vista and before, but crashes on Windows 8 or just calls the callback-function just once.
The debugger tells me it's a corrupt heap, but the code is the same as before.
"(...)
LPLOGFONT lf = (LPLOGFONT) malloc (sizeof(*lf));
memset(lf, '\0', sizeof(*lf));
lf->lfFaceName = '\0';
lf->lfCharSet = DEFAULT_CHARSET;
HRESULT hr;
HDC hdc = GetDC(0);
hr = EnumFontFamiliesEx(hdc, lf, fontProc, 0, 0);
(...)"
fontProc is defined as EnumFontFamExProc and returns 1 to continue the enumeration.
Any comments?