comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: How to get the mouse position with JEWL?
Date: Thu, 21 Oct 2010 21:38:46 +0200
Date: 2010-10-21T21:38:44+02:00	[thread overview]
Message-ID: <1dbwvwvv5nn1h.1s4mepzsbnf54.dlg@40tude.net> (raw)
In-Reply-To: i9q37c$m94$1@speranza.aioe.org

On Thu, 21 Oct 2010 19:10:37 +0000 (UTC), tmoran@acm.org wrote:

>> Surely it is better to use it from win32ada than making own binding.
> There are several reasons:
> 1. The program that polled for mouse position is a console mode
> program, not an event driven Windows program (which of course would
> have watched for a WM_MOUSEMOVE event instead).  The call to GetCursorPos
> is the only inported function it uses, so win32ada would be overkill.

I don't think so. win32ada is a maintained library, it is better to rely on
other people's work. Especially because of the 64 vs. 32 bit issue.

> 2. The win32ada I have is dated 2002.  Much of my Windows code predates
> that (it uses CLAW) so I never started using win32ada.

Yes, if you are using CLAW. However then, I would expect a call to a CLAW's
equivalent of the function.

> 3. My copy of win32.ads declares
>   subtype PVOID is System.Address;
> System.Address is not the same as an access value to my preferred Ada
> compiler.

But PVOID is an address, if an Ada's access type is not, then it cannot be
used for PVOID.

> 4. I also note that my copy of win32-windef.ads says, in the private part,
>   pragma Convention(C_Pass_By_Copy, POINT);
> which would of course make Jeffrey Carter's suggestion fail.
> The possibility of surprises like that makes me leary.

It only means that this win32ada (the AdaCore's one?) cannot be used with
your compiler. Win32 bindings are not necessarily portable across different
Ada compilers. You need win32ada for your compiler and if you don't have it
then, yes, you must roll up your own.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2010-10-21 19:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-20  9:04 How to get the mouse position with JEWL? tolkamp
2010-10-20 11:42 ` Manuel Collado
2010-10-20 17:20   ` tolkamp
2010-10-20 22:22     ` Manuel Collado
2010-10-20 22:51       ` tmoran
2010-10-21  2:59         ` Jeffrey Carter
2010-10-21  4:08           ` tmoran
2010-10-21  7:31         ` Dmitry A. Kazakov
2010-10-21 19:10           ` tmoran
2010-10-21 19:38             ` Dmitry A. Kazakov [this message]
2010-10-22  0:39               ` tmoran
2010-10-22  7:35                 ` Dmitry A. Kazakov
2010-10-22 10:10                 ` Frank J. Lhota
2010-10-21 15:23         ` tolkamp
2010-10-21 16:47           ` Georg Bauhaus
2010-10-21 17:09             ` tolkamp
2010-10-21 17:24               ` Niklas Holsti
2010-10-21 20:34         ` tolkamp
2010-10-22 13:55       ` tolkamp
2010-10-22 22:15         ` Manuel Collado
2010-10-23 15:26           ` tolkamp
2010-10-21 21:50 ` Manuel Collado
2010-10-22 10:40   ` tolkamp
replies disabled

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