NO

Author Topic: Wingdi.h : EnumFontFamExProc  (Read 2367 times)

GestRegistered

  • Guest
Wingdi.h : EnumFontFamExProc
« on: November 13, 2009, 06:23:34 pm »
Hello,

In Wingdi.h, the definition of the callback function EnumFontFamExProc used by the EnumFontFamiliesEx api mismatches between msdn and Pelle C Compiler :

In msdn, it looks like :
int CALLBACK EnumFontFamExProc (ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme,
int  FontType, LPARAM lParam );

In Wingdi.h, the first and the second parameters are LOGFONT and TEXTMETRIC structure
instead of ENUMLOGFONTEX and NEWTEXTMETRIC.

WINGDIAPI int WINAPI EnumFontFamiliesExA(HDC,LPLOGFONTA,FONTENUMPROCA,LPARAM,DWORD);
WINGDIAPI int WINAPI EnumFontFamiliesExW(HDC,LPLOGFONTW,FONTENUMPR   OCW,LPARAM,DWORD);

...
#ifdef STRICT
typedef int (CALLBACK *OLDFONTENUMPROCA)(CONST LOGFONTA*,CONST TEXTMETRICA*,DWORD,LPARAM);
typedef int (CALLBACK *OLDFONTENUMPROCW)(CONST LOGFONTW*,CONST TEXTMETRICW*,DWORD,LPARAM);
typedef OLDFONTENUMPROCA FONTENUMPROCA;
typedef OLDFONTENUMPROCW FONTENUMPROCW;
....

I get some warnings when I use the msdn style and the code works but the fields elfFullName,
elfStyle, elfScript from EnumLogFontEx structure are not available.

Best regards.