Delphi 5 TDateTimePicker Format

During add Delphi 5 compatibility to the Purchase Order calculation sample of HotXLS Delphi Excel Spreadsheet component, an error occurred while compiling under Delphi 5.

The line which set the date format of the TDateTimePicker control does not compile:

DateTimePicker.Format := ‘MM/dd/yyyy’;

TDateTimePicker control of Delphi is a wrapper around a Microsoft control.

Continue Reading …

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 …