Delphi Incompatible type tagLOGBRUSH tagLOGBRUSH32

When using Delphi XE2 or above editions to compile coeds likes below:

procedure VEMRCREATEBRUSHINDIRECT(Data: PEMRCreateBrushIndirect);
begin
GDIObjects[Data^.ihBrush] := CreateBrushIndirect(Data^.lb);
//GDIObjects and CreateBrushIndirect are defined in the winapi.windows unit.
end;

The compiler says: E2010 Incompatible types: ‘tagLOGBRUSH’ and ‘tagLOGBRUSH32’.

The solution to fix this compiling error is:

procedure VEMRCREATEBRUSHINDIRECT(Data: PEMRCreateBrushIndirect);
var
LogBrush: TLogBrush;Continue Reading …