- Код: Выделить всё
...
{$mode objfpc}
...
procedure CheckFont(const DC: HDC;);
function EnumFontFamExProc(
//
var ELogFont: TEnumLogFontEx;
//
var Metric: TNewTextMetricEx;
//
FontType: LongInt; Data: Pointer): Integer; stdcall;
begin
//
end;
var
//
FontData: TLOGFONTA;
begin
//
FillChar(FontData, SizeOf(FontData), 0);
//
EnumFontFamiliesEx(
//
DC, FontData,
//
WndProc(@EnumFontFamExProc), 0, 0);
end;
Почему-то, получаю сообщение:
Error: Incompatible type for arg no. 3: Got "<procedure variable type of function(LongWord,LongWord,LongInt,LongInt):LongInt;StdCall>", expected "<procedure variable type of function(var ENUMLOGFONTEX,var NEWTEXTMETRICEXA,LongInt,LongInt):LongInt;StdCall>"
Если заменить "{$mode objfpc}" на "{$mode Delphi}" и "WndProc(@EnumFontFamExProc)" на "@EnumFontFamExProc", то всё работает, но мне нужен режим FPC, а не Delphi...
Может кто подскажет, как это исправить?
