comp.lang.ada
 help / color / mirror / Atom feed
From: "Josh Highley" <joshhighley@hotmail.com>
Subject: Win32 joystick problems
Date: 1999/08/15
Date: 1999-08-16T04:09:46+00:00	[thread overview]
Message-ID: <7p82ua$p8r$1@bgtnsc02.worldnet.att.net> (raw)

I've been trying to read the position of the joystick using the Win32
bindings included with Gnat 3.11 and AdaGIDE 6.21.  I'm running this under
Win 95.  Since I haven't done any Win32 programming, I created a quick and
simple test program.  However, I can't get it to link.  It compiles okay,
but when I build it, gnatlink returns:

gnatlink -g joytest.ali
./joytest.o: In function 'ada_joytest':
C:/GNAT311/Programs/c:/gnat311/programs/joytest.adb:23: undefined reference
to 'joyGetPos@8'
gnatmake:  *** link failed.

Here's the test program I'm trying to run:
--------------------------------------------------------------
with ada.text_io;
with win32.mmsystem;

use ada.text_io;
use win32.mmsystem;

procedure joytest is

joystick_info : lpjoyinfo;
joyID         : win32.UINT := 1; -- ?? I'm not sure about this value
result        : mmresult;

package mmresult_io is new ada.text_io.modular_io(mmresult);
package UINT_io is new ada.text_io.modular_io(Win32.UINT);
use mmresult_io;
use UINT_io;

begin
     --  This is the function prototype for joyGetPos:
     --   function joyGetPos(
     --                uJoyID: Win32.UINT;
     --                lpji  : LPJOYINFO)
     --               return MMRESULT;
    result := joyGetPos(joyID , joystick_info);
    put("Result: ");
    put(result);
    new_line;
    put("Joystick X-axis: ");
    put(joystick_info.wxpos);
    new_line;
    put("Joystick Y-axis: ");
    put(joystick_info.wypos);
    new_line;
end joytest;
----------------------------------------------------

Like I said, I'm new to Win32 programming so the problem might be obvious to
someone who knows what they are doing.  Any help would be greatly
appreciated.

Thanks,

Josh
joshhighley@hotmail.com






             reply	other threads:[~1999-08-15  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-15  0:00 Josh Highley [this message]
1999-08-16  0:00 ` Win32 joystick problems David C. Hoos, Sr.
replies disabled

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