Buffer_Size:=Getobject(Mon_Bitmap,
Sizeof(Bitmap), -- this line obviously don't works
Buffer);
'Size_in_Storage_Elements
What is the Ada type of Bitmap?
from GetObject:
hObject ...
nCount int Secifies the number of bytes to be copied
to the buffer
lpObject ...
What do you want to copy?
The bitmap related structures in the Window API provide
information to compute the size of the bitmap in bytes
IIRC.
Did you mean 'Max_Size_In_Storage_Elements?
There's no Size_In_Storage_Elements attribute listed in either the RM or
amongst GNAT's implementation defined attributes.
-- Marc A. Criley
-- www.mckae.com
-- DTraq - XPath In Ada - XML EZ Out
Yes.
There is the 'Max_Size_In_Storage_Units attribute, which may be what you
want.
The 'Size attribute gives the size in bits of a subtype or object. For a
stand-alone object, 'Size is usually a multiple of System.Storage_Unit,
which is the number of bits in a storage unit (8 on a byte-oriented
processor).
Note that 'Size can differ between a subtype and an object. For many
platforms and compilers:
Boolean'Size = 1
Natural'Size = 31
B : Boolean;
N : Natural;
B'Size = 8;
N'Size = 32
So Object'Size / System.Storage_Unit will give you the correct value for
an object. It may be better to base your values on the object than on
the subtype.
Another way is to instantiate Ada.Storage_IO for the subtype. This then
gives you the constant Buffer_Size, which is what you want. This is
rather a heavyweight solution, however.
--
Jeffrey Carter
"Now go away or I shall taunt you a second time."
Monty Python and the Holy Grail
E-mail: jeffrey_r_carter-nr [commercial-at]
raytheon [period | full stop] com
See:
http://en.wikibooks.org/wiki/Programming:Ada:Attributes:'Size
Martin
--
mailto://kris...@users.sourceforge.net
Ada programming at: http://ada.krischik.com