Im new to Delphi, trying to make debug on a project which is implemented years ago. My ide is Delphi 2010 and the code with error;
function DrawTextExW(hDC: HDC; lpString: PWideChar; nCount: Integer; var lpRect:
TRect; uFormat: UINT; dtp: PDRAWTEXTPARAMS): Integer;
const
MAX_STATIC_BUFFER = 8192;
const
STATIC_BUFFER_LEN: integer = 8192;
const
DT_PREFIXONLY = $00200000;
var
...
tm: TTextMetricA;
...
begin
...
GetTextMetrics(hDC, tm); //Error Line
if (uFormat and DT_EXTERNALLEADING) = DT_EXTERNALLEADING then
lh := tm.tmHeight + tm.tmExternalLeading
else
lh := tm.tmHeight;
...
end
Getting "[DCC Error] ElVCLUtils.pas(3555): E2033 Types of actual and formal var parameters must be identical" error in that line. What is wrong with this code?
DrawTextExW
is already provided by the OS. Maybe your project comes from a time when you were targeting Ansi versions of Windows, like Windows 98. Those versions aren't supported by Microsoft or Embarcadero, so maybe you don't need to support them, either. Then you could delete all this code instead of fixing it. – Rob Kennedy