D7 compatibility & COM: WordBool incompatibility
Original Reporter info from Mantis: mspiller
-
Reporter name:
Original Reporter info from Mantis: mspiller
- Reporter name:
Description:
When running on delphi result is:
-1, -1, -1, -1, 1, 1
on FPC it is:
1, 1, 65535, 65535, 1, 1
The problem is when using for example MSXML2 through COM, boolean properties are ignored unless forced their values with WordBool(-1) instead of True.
for more details see:
http://blogs.msdn.com/oldnewthing/archive/2004/12/22/329884.aspx
test procedure:
procedure TForm1.FormCreate(Sender: TObject);
var
x: WordBool;
a: Boolean;
begin
x := True;
ShowMessage(IntToStr(Integer(x)));
ShowMessage(IntToStr(Ord(x)));
x := WordBool(-1);
ShowMessage(IntToStr(Integer(x)));
ShowMessage(IntToStr(Ord(x)));
a := true;
ShowMessage(IntToStr(Integer(a)));
ShowMessage(IntToStr(Ord(a)));
end;
Mantis conversion info:
- Mantis ID: 10613
- Version: 2.3.1
- Fixed in version: 2.4.0
- Fixed in revision: 9898 (#8349cde7)