From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID,TO_NO_BRKTS_PCNT,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4324ae2d703ae7ff,start X-Google-Attributes: gid103376,public From: "Josh Highley" Subject: Another Win32 joystick problem. Date: 1999/08/16 Message-ID: <7pamd6$eqk$1@bgtnsc03.worldnet.att.net>#1/1 X-Deja-AN: 513652479 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc03.worldnet.att.net 934862054 15188 12.66.96.46 (17 Aug 1999 03:54:14 GMT) Organization: AT&T WorldNet Services X-MSMail-Priority: Normal NNTP-Posting-Date: 17 Aug 1999 03:54:14 GMT Newsgroups: comp.lang.ada Date: 1999-08-17T03:54:14+00:00 List-Id: 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. Since my last post, I've added "pragma Linker_Options("-lwinmm");" It now compiles and builds (thanks Mr. Hoos) but when I run the program, the call to joyGetPos returns an error code of 11 (Invalid Program Format Attempted to Load). Then, "put(joystick_info.wxpos);" raises a constraint_error. As a check, I tried calling "joyGetNumDevs" but it returned 16. I have a single joystick and I'm 99.9% sure that it is set up properly. So now my obvious question is why is the program returning an error code about loading an invalid program format in the middle of the program? Once again, here's my test program: ---------------------------------------------------------- with ada.text_io; with win32.mmsystem; use ada.text_io; use win32.mmsystem; procedure joytest is pragma Linker_Options("-lwinmm"); joystick_info : lpjoyinfo; joyID : win32.UINT := 0; 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 -- function joyGetPos( -- uJoyID: Win32.UINT; -- lpji : LPJOYINFO) -- return MMRESULT; result := joyGetPos(joyID , joystick_info); -- returning error 11 put("Result: "); put(result); new_line; put("Joystick X-axis: "); put(joystick_info.wxpos); -- this line raises a constraint_error new_line; put("Joystick Y-axis: "); put(joystick_info.wypos); new_line; end joytest; -------------------------------------------------------- Thanks, Josh joshhighley@hotmail.com