The Delphi Bug List

Entry No.
622
RTL - Win - Windows
Compiling any unit referring to OffsetWindowOrgEx produces Compiler Error "Ambiguous overloaded call"
1.02 2.01 3.0 3.01 3.02 4.0 4.01 4.02 4.03 5.0 5.01 6.0 6.01 6.02 Kylix 1.0
N/AN/AN/AN/AN/AAbsentAbsentAbsentAbsentExistsExistsFixedFixedFixedN/A
Description
Reported by Richard Cook; checked by Reinier Sterkenburg
Analysis: Looking at the Windows.Pas unit, OffsetWindowOrgEx has been given 2 definitions, differing in their final parameter. In one version, it is "var Points", in the other it is "Points: PPoint", ie BOTH are pointers - hence there's no way the compiler will ever tell the difference!
Solution / workaround
WorkAround: Comment out the references to the first definition of OffsetWindowOrgEx (the one that uses "var: Points") in Source\RTL\Win\Windows.Pas lines 16099 and 29243. [This then leaves the "Points: PPoint" definition, which fits better with the way OffsetWindowOrgEx is defined in the help-files.]
User-contributed comments
Hallvard Vassbotn
30 Aug 2001  09:15 AM GMT
Bug #622 has been fixed in Delphi 6.0. The Windows unit is unchanged, but the compiler is now smart enough to see the difference of a PPoint and any other structure:
uses
  Windows;
var
  Points: array [0..10] of TPoint;
begin
  OffsetViewportOrgEx(0, 0, 0, Points);
  OffsetViewportOrgEx(0, 0, 0, @Points[0]);
end.
Latest update of this entry: 2002-04-09

Post a comment on this bug


Index page
Delphi Bug List home page
The Delphi Bug Lists are presently maintained by Jordan Russell, who has taken over this task from Reinier Sterkenburg since August 2000.
All feedback is appreciated. See also the feedback section of the Delphi Bug List home page.