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/A | N/A | N/A | N/A | N/A | Absent | Absent | Absent | Absent | Exists | Exists | Fixed | Fixed | Fixed | N/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. |
|
|