comp.lang.ada
 help / color / mirror / Atom feed
* How to handle Bitmaps in Gnat Ada95.
@ 1999-09-14  0:00 luis_polasek
  1999-09-14  0:00 ` tmoran
  0 siblings, 1 reply; 2+ messages in thread
From: luis_polasek @ 1999-09-14  0:00 UTC (permalink / raw)


Hi...

        I'm building an Ada package to handle BMPs graphics under
Windows32. What I'm trying to do is to open a window under Windows and
draw the read BMP in this window pixel by pixel.

        For doing this I'm trying to interface Ada with the C language,
using the <windows.h> library.

        The problem arises when I try to link the object file, with the
following error code:
 "undefined reference to someFunction@20"
(where "someFunction" is an example name). The weird thing is that it
is looking for a function concatenated to "@20", and y don't know what
this means.

        If somebody can tell me how to solve this "undefined reference
to ..." error, I would appreciate.

Ps: another question, anybody knows how to create a window in Windows
for handling pixels, using the library <windows.h> (the Win32 API). Or
another way to handle bitmaps in Gnat Ada95.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to handle Bitmaps in Gnat Ada95.
  1999-09-14  0:00 How to handle Bitmaps in Gnat Ada95 luis_polasek
@ 1999-09-14  0:00 ` tmoran
  0 siblings, 0 replies; 2+ messages in thread
From: tmoran @ 1999-09-14  0:00 UTC (permalink / raw)


>is looking for a function concatenated to "@20", and y don't know what
>this means.
  The @20 means there are 20 bytes of parameters, which most
likely means there are 5, 4-byte parameters.  So if you declared, say,
    function Some_Function(a,b,c,d,e : Integer) return Integer;
    pragma Import(Stdcall, Some_Function, "someFunction");
the compiler would generate a reference to someFunction@20.  The
most likely problem is that it needs 4, or 6, or some other number
of parameters. Thus if the library contains
  function someFunction(a,b,c: Integer) return Integer;
it will have an entry for someFunction@12, but not someFunction@20.

>Ps: another question, anybody knows how to create a window in Windows
>for handling pixels, using the library <windows.h> (the Win32 API).
  Yes.
Claw, of course, does it.  Note that Bitmaps (Device Dependent
Bitmaps) and DIBitmaps (Device Independent Bitmaps) are different
things in Windows.  A Bitmap is a processed thing that you can
quickly paint into a window, but it's hard to get at its pixels.
A Device Independent Bitmap is essentially a .bmp file (minus a
little header) that contains a rectangular array of pixels.  It
sounds like you are more interested in a DIBitmap.
SetDIBitsToDevice will draw a DIBitmap.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-09-14  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-14  0:00 How to handle Bitmaps in Gnat Ada95 luis_polasek
1999-09-14  0:00 ` tmoran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox