Developed by: John Walker, JSW Technology
Distributed by: Aonix
Copyright John Walker & JSW Technology 1997-2001.
All Rights Reserved.
The information contained herein is subject to change without notice.
ObjectAda is a trademark of Aonix
Microsoft, Visual C++, Win32 and Windows NT are trademarks of Microsoft, Inc.
Last updated: 9 October 2000
This Release Note contains information that supplements the Ada Binding to Win32 (WinAPI) software and documentation.
Go back to Ada Binding to Win32 (WinAPI)
Go back to start of JSW Technology Home Page
The 64 bit types, Int64 and Unsigned_Int64, in package VCTypes should have been declared with a representation clause, an alignment attribute and pragma convention C_Pass_By_Copy.
The full declaration of these types should be:
type Int64 is record
Low : unsigned;
High : int;
end record;
for Int64 use record
Low at 0 range 0 .. 31;
High at 4 range 0 .. 31;
end record;
for Int64'Alignment use 1;
pragma Convention (C_Pass_By_Copy, Int64);
type Unsigned_Int64 is record
Low : unsigned;
High : unsigned;
end record;
for Unsigned_Int64 use record
Low at 0 range 0 .. 31;
High at 4 range 0 .. 31;
end record;
for Unsigned_Int64'Alignment use 1;
pragma Convention (C_Pass_By_Copy, Unsigned_Int64);
OpenPack for Windows Version 7.2 includes WinAPI Version 3.1 and further samples derived from the examples in Programming Windows 95 Edition 4 by Charles Petzold and published by Microsoft Press in winapi\samples\petzold\edition4.
These samples and associated documentation are also available from this web site at Petzold Edition 4 Samples.
The C++ Mapping Guide is not included on the CD ObjectAda Version 7.2 Documentation. It is included in the online help.
Where a global object (function or data) is declared twice, once with a leading underline and once without, and both objects have the same type then the object with the leading underline is mapped to Ada without the underline and the object without the leading underline is not mapped.
This "optimisation" has proved to be too general as in the case of toupper, which has a different specification to _toupper. In this case the Ada function, toupper, is, incorrectly, mapped to the C function _toupper.
This problem also affects Version 3.1 of the bindings. The optimisation has been applied in the following cases.
The optimisation has been removed from Version 3.2 of the bindings.
To work around this problem copy the function specification from the binding and remove the Link_Name. This will cause ObjectAda to map the function name to the link name. Note that it is case sensitive.
For example, instead of:
function toupper (
P1 : VC.Int)
return VC.Int;
pragma Import (cdecl, toupper, Link_Name=>"__toupper");
use:
function toupper (
P1 : VC.Int)
return VC.Int;
pragma Import (cdecl, toupper);