* How to interface in ADA with Microsoft joystick? @ 2010-10-03 15:07 tolkamp 2010-10-03 15:21 ` Dmitry A. Kazakov 0 siblings, 1 reply; 26+ messages in thread From: tolkamp @ 2010-10-03 15:07 UTC (permalink / raw) Is it possible to interface within an ADA program with a Microsoft Sidewinder Joystick? If yes, which code have to be added or where can I find more information about this subject? ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-03 15:07 How to interface in ADA with Microsoft joystick? tolkamp @ 2010-10-03 15:21 ` Dmitry A. Kazakov 2010-10-04 15:16 ` tolkamp 0 siblings, 1 reply; 26+ messages in thread From: Dmitry A. Kazakov @ 2010-10-03 15:21 UTC (permalink / raw) On Sun, 3 Oct 2010 08:07:06 -0700 (PDT), tolkamp wrote: > Is it possible to interface within an ADA program with a Microsoft > Sidewinder Joystick? Yes > If yes, which code have to be added or where can I find more > information about this subject? http://msdn.microsoft.com/en-us/library/dd757121%28v=VS.85%29.aspx Ada bindings to Windows API called Win32Ada. In particular the package responsible for the multimedia API (mmsystem.dll) is Win32.MMSystem. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-03 15:21 ` Dmitry A. Kazakov @ 2010-10-04 15:16 ` tolkamp 2010-10-04 16:18 ` Dmitry A. Kazakov 0 siblings, 1 reply; 26+ messages in thread From: tolkamp @ 2010-10-04 15:16 UTC (permalink / raw) On 3 okt, 17:21, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de> wrote: > On Sun, 3 Oct 2010 08:07:06 -0700 (PDT), tolkamp wrote: > > Is it possible to interface within an ADA program with a Microsoft > > Sidewinder Joystick? > > Yes > > > If yes, which code have to be added or where can I find more > > information about this subject? > > http://msdn.microsoft.com/en-us/library/dd757121%28v=VS.85%29.aspx > > Ada bindings to Windows API called Win32Ada. In particular the package > responsible for the multimedia API (mmsystem.dll) is Win32.MMSystem. > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de Thank you Dmitry for your reaction. I have downloaded win32ada and unzipped. My question is: must the result of SETUP.EXE be stored in GNAT/bin/source? Regards, Fred Tolkamp ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-04 15:16 ` tolkamp @ 2010-10-04 16:18 ` Dmitry A. Kazakov 2010-10-04 17:54 ` tolkamp 0 siblings, 1 reply; 26+ messages in thread From: Dmitry A. Kazakov @ 2010-10-04 16:18 UTC (permalink / raw) On Mon, 4 Oct 2010 08:16:16 -0700 (PDT), tolkamp wrote: > I have downloaded win32ada and unzipped. My question is: > must the result of SETUP.EXE be stored in GNAT/bin/source? Hmm, with GNAT it should be a file, e.g. win32ada-gpl-2010.exe. Which you call in order to install Win32Ada into the GNAT Ada environment. The primary download page is: http://libre.adacore.com/libre/download After installation you include "with win32ada.gpr" into your GNAT project file and that basically is. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-04 16:18 ` Dmitry A. Kazakov @ 2010-10-04 17:54 ` tolkamp 2010-10-04 18:58 ` Dmitry A. Kazakov 0 siblings, 1 reply; 26+ messages in thread From: tolkamp @ 2010-10-04 17:54 UTC (permalink / raw) On 4 okt, 18:18, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de> wrote: > On Mon, 4 Oct 2010 08:16:16 -0700 (PDT), tolkamp wrote: > > I have downloaded win32ada and unzipped. My question is: > > must the result of SETUP.EXE be stored in GNAT/bin/source? > > Hmm, with GNAT it should be a file, e.g. win32ada-gpl-2010.exe. Which you > call in order to install Win32Ada into the GNAT Ada environment. The > primary download page is: > > http://libre.adacore.com/libre/download > > After installation you include "with win32ada.gpr" into your GNAT project > file and that basically is. > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de Hello Dmitry, Now I have installed win32. Its body file and much other files are found in GNAT/bin/source/src/ObjectAda. My project file is named "flight_simul.gpr" which has the contents: project Flight_Simul is for Main use ("flight_simul_main.adb", "flight_deck.ads"" ... etc); end Flight_Simul; My question: where I have to include "with win32ada.gpr"? ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-04 17:54 ` tolkamp @ 2010-10-04 18:58 ` Dmitry A. Kazakov 2010-10-04 19:30 ` tolkamp 0 siblings, 1 reply; 26+ messages in thread From: Dmitry A. Kazakov @ 2010-10-04 18:58 UTC (permalink / raw) On Mon, 4 Oct 2010 10:54:05 -0700 (PDT), tolkamp wrote: > Now I have installed win32. Its body file and much other files are > found in GNAT/bin/source/src/ObjectAda. ObjectAda? That is Aonix, not AdaCore (GNAT). Are you using ObjectAda or GNAT? These are different compilers from different vendors. It should be (if GNAT): GNAT/<distribution-name>/include/win32ada GNAT/<distribution-name>/lib/win32ada GNAT/<distribution-name>/lib/gnat/win32ada.gpr > My project file is named "flight_simul.gpr" which has the contents: > project Flight_Simul is > for Main use ("flight_simul_main.adb", "flight_deck.ads"" ... > etc); > end Flight_Simul; > My question: where I have to include "with win32ada.gpr"? with "win32ada.gpr"; project Flight_Simul is for Main use ("flight_simul_main.adb", "flight_deck.ads"" ... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-04 18:58 ` Dmitry A. Kazakov @ 2010-10-04 19:30 ` tolkamp 2010-10-04 19:46 ` tolkamp 0 siblings, 1 reply; 26+ messages in thread From: tolkamp @ 2010-10-04 19:30 UTC (permalink / raw) On 4 okt, 20:58, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de> wrote: > On Mon, 4 Oct 2010 10:54:05 -0700 (PDT), tolkamp wrote: > > Now I have installed win32. Its body file and much other files are > > found in GNAT/bin/source/src/ObjectAda. > > ObjectAda? That is Aonix, not AdaCore (GNAT). Are you using ObjectAda or > GNAT? These are different compilers from different vendors. > > It should be (if GNAT): > > GNAT/<distribution-name>/include/win32ada > GNAT/<distribution-name>/lib/win32ada > GNAT/<distribution-name>/lib/gnat/win32ada.gpr > > > My project file is named "flight_simul.gpr" which has the contents: > > project Flight_Simul is > > for Main use ("flight_simul_main.adb", "flight_deck.ads"" ... > > etc); > > end Flight_Simul; > > My question: where I have to include "with win32ada.gpr"? > > with "win32ada.gpr"; > project Flight_Simul is > for Main use ("flight_simul_main.adb", "flight_deck.ads"" ... > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de From the side http://libre.adacore.com/libre/download2 I have downloaded the file win32ada-gpl-2010.exe. Is this the correct file? ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-04 19:30 ` tolkamp @ 2010-10-04 19:46 ` tolkamp 2010-10-05 7:30 ` Dmitry A. Kazakov 0 siblings, 1 reply; 26+ messages in thread From: tolkamp @ 2010-10-04 19:46 UTC (permalink / raw) On 4 okt, 21:30, tolkamp <f.tolk...@gmail.com> wrote: > On 4 okt, 20:58, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de> > wrote: > > > > > > > On Mon, 4 Oct 2010 10:54:05 -0700 (PDT), tolkamp wrote: > > > Now I have installed win32. Its body file and much other files are > > > found in GNAT/bin/source/src/ObjectAda. > > > ObjectAda? That is Aonix, not AdaCore (GNAT). Are you using ObjectAda or > > GNAT? These are different compilers from different vendors. > > > It should be (if GNAT): > > > GNAT/<distribution-name>/include/win32ada > > GNAT/<distribution-name>/lib/win32ada > > GNAT/<distribution-name>/lib/gnat/win32ada.gpr > > > > My project file is named "flight_simul.gpr" which has the contents: > > > project Flight_Simul is > > > for Main use ("flight_simul_main.adb", "flight_deck.ads"" ... > > > etc); > > > end Flight_Simul; > > > My question: where I have to include "with win32ada.gpr"? > > > with "win32ada.gpr"; > > project Flight_Simul is > > for Main use ("flight_simul_main.adb", "flight_deck.ads"" ... > > > -- > > Regards, > > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de > > From the sidehttp://libre.adacore.com/libre/download2I have > downloaded the file win32ada-gpl-2010.exe. > Is this the correct file? In addition: the win32 spec and body file is also found in GNAT/bin/source/src/gnat. ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-04 19:46 ` tolkamp @ 2010-10-05 7:30 ` Dmitry A. Kazakov 2010-10-05 10:19 ` tolkamp 0 siblings, 1 reply; 26+ messages in thread From: Dmitry A. Kazakov @ 2010-10-05 7:30 UTC (permalink / raw) On Mon, 4 Oct 2010 12:46:12 -0700 (PDT), tolkamp wrote: > On 4 okt, 21:30, tolkamp <f.tolk...@gmail.com> wrote: >> From the sidehttp://libre.adacore.com/libre/download2I have >> downloaded the file win32ada-gpl-2010.exe. >> Is this the correct file? I guess so, provided, you are using GNAT GPL 2010. > In addition: the win32 spec and body file is also found in > GNAT/bin/source/src/gnat. Should be .../include/win32ada/ But that depends on the win32ada.gpr file. If you want to know for sure where are the specifications, you look into this file. The file must be located under .../lib/gnat, because that is the default directory where GNAT searches for gpr-files (others are form the ADA_PROJECT_PATH environment variable). Now in that file you will see the path to sources, e.g. project Win32Ada is for Languages use ("ada"); for Source_Dirs use ("../../include/win32ada"); for Library_Dir use "../../lib/win32ada"; for Library_Name use "win32ada"; for Externally_Built use "true"; end Win32Ada; So the source directory is .../lib/gnat/../../include/win32ada = ../include/win32ada -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-05 7:30 ` Dmitry A. Kazakov @ 2010-10-05 10:19 ` tolkamp 2010-10-05 10:55 ` AdaMagica 2010-10-05 12:21 ` Dmitry A. Kazakov 0 siblings, 2 replies; 26+ messages in thread From: tolkamp @ 2010-10-05 10:19 UTC (permalink / raw) On 5 okt, 09:30, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de> wrote: > On Mon, 4 Oct 2010 12:46:12 -0700 (PDT), tolkamp wrote: > > On 4 okt, 21:30, tolkamp <f.tolk...@gmail.com> wrote: > >> From the sidehttp://libre.adacore.com/libre/download2Ihave > >> downloaded the file win32ada-gpl-2010.exe. > >> Is this the correct file? > > I guess so, provided, you are using GNAT GPL 2010. > > > In addition: the win32 spec and body file is also found in > > GNAT/bin/source/src/gnat. > > Should be .../include/win32ada/ > > But that depends on the win32ada.gpr file. If you want to know for sure > where are the specifications, you look into this file. The file must be > located under .../lib/gnat, because that is the default directory where > GNAT searches for gpr-files (others are form the ADA_PROJECT_PATH > environment variable). Now in that file you will see the path to sources, > e.g. > > project Win32Ada is > for Languages use ("ada"); > for Source_Dirs use ("../../include/win32ada"); > for Library_Dir use "../../lib/win32ada"; > for Library_Name use "win32ada"; > for Externally_Built use "true"; > end Win32Ada; > > So the source directory is > > .../lib/gnat/../../include/win32ada = ../include/win32ada > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de Finally I had success to include the package Win32 in my project. Compilation of the project gives the following error message for package win32-winnt.ads: “representation item appears too late” pragma Convention(C, anonymous1_t); -- winnt.h:186 pragma Convention(C, LUID_AND_ATTRIBUTES); -- winnt.h:2000 pragma Convention(C, SID_IDENTIFIER_AUTHORITY); By the way, I use GNAT GPL 2009 (version 4.3.1). ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-05 10:19 ` tolkamp @ 2010-10-05 10:55 ` AdaMagica 2010-10-05 12:21 ` Dmitry A. Kazakov 1 sibling, 0 replies; 26+ messages in thread From: AdaMagica @ 2010-10-05 10:55 UTC (permalink / raw) On 5 Okt., 12:19, tolkamp <f.tolk...@gmail.com> wrote: > Finally I had success to include the package Win32 in my project. > Compilation of the project gives the following error message for > package win32-winnt.ads: > “representation item appears too late” > > pragma Convention(C, anonymous1_t); -- winnt.h:186 > pragma Convention(C, LUID_AND_ATTRIBUTES); -- winnt.h:2000 > pragma Convention(C, SID_IDENTIFIER_AUTHORITY); > > By the way, I use GNAT GPL 2009 (version 4.3.1). This is a problem with freezing rules. Just move the pragmas directly after the respective declaration. ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-05 10:19 ` tolkamp 2010-10-05 10:55 ` AdaMagica @ 2010-10-05 12:21 ` Dmitry A. Kazakov 2010-10-05 15:32 ` tolkamp 1 sibling, 1 reply; 26+ messages in thread From: Dmitry A. Kazakov @ 2010-10-05 12:21 UTC (permalink / raw) On Tue, 5 Oct 2010 03:19:27 -0700 (PDT), tolkamp wrote: > Finally I had success to include the package Win32 in my project. > Compilation of the project gives the following error message for > package win32-winnt.ads: > ļæ½representation item appears too lateļæ½ > > pragma Convention(C, anonymous1_t); -- winnt.h:186 > pragma Convention(C, LUID_AND_ATTRIBUTES); -- winnt.h:2000 > pragma Convention(C, SID_IDENTIFIER_AUTHORITY); > > By the way, I use GNAT GPL 2009 (version 4.3.1). 1. The actual version of GNAT GPL is 2010. 2. The version I have does not contain the text you quoted. 3. I don't remember this problem in the earlier versions (2008 and 2009). => My guess is that you are still using Aonix's win32ada for Ada 95. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-05 12:21 ` Dmitry A. Kazakov @ 2010-10-05 15:32 ` tolkamp 2010-10-05 16:11 ` Andre 2010-10-05 17:03 ` Dmitry A. Kazakov 0 siblings, 2 replies; 26+ messages in thread From: tolkamp @ 2010-10-05 15:32 UTC (permalink / raw) On 5 okt, 14:21, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de> wrote: > On Tue, 5 Oct 2010 03:19:27 -0700 (PDT), tolkamp wrote: > > Finally I had success to include the package Win32 in my project. > > Compilation of the project gives the following error message for > > package win32-winnt.ads: > > ´representation item appears too late¡ > > > pragma Convention(C, anonymous1_t); -- winnt.h:186 > > pragma Convention(C, LUID_AND_ATTRIBUTES); -- winnt.h:2000 > > pragma Convention(C, SID_IDENTIFIER_AUTHORITY); > > > By the way, I use GNAT GPL 2009 (version 4.3.1). > > 1. The actual version of GNAT GPL is 2010. > 2. The version I have does not contain the text you quoted. > 3. I don't remember this problem in the earlier versions (2008 and 2009). > > => My guess is that you are still using Aonix's win32ada for Ada 95. > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de Little progress. The compilation is error free now. Sorry, I selected the wrong include directory. What is the next step to interface with the Microsoft Joystick? ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-05 15:32 ` tolkamp @ 2010-10-05 16:11 ` Andre 2010-10-05 17:03 ` Dmitry A. Kazakov 1 sibling, 0 replies; 26+ messages in thread From: Andre @ 2010-10-05 16:11 UTC (permalink / raw) For the joystick interface. On sourceforge there is the GNavi project. It includes a thin binding to the Windows SDK. Inside their is a package GWindows.HID. I used this package to all kind of joystick and other Human Interface Devices. with regards, Andr� > On 5 okt, 14:21, "Dmitry A. Kazakov"<mail...@dmitry-kazakov.de> > wrote: >> On Tue, 5 Oct 2010 03:19:27 -0700 (PDT), tolkamp wrote: >>> Finally I had success to include the package Win32 in my project. >>> Compilation of the project gives the following error message for >>> package win32-winnt.ads: >>> �representation item appears too late� >> >>> pragma Convention(C, anonymous1_t); -- winnt.h:186 >>> pragma Convention(C, LUID_AND_ATTRIBUTES); -- winnt.h:2000 >>> pragma Convention(C, SID_IDENTIFIER_AUTHORITY); >> >>> By the way, I use GNAT GPL 2009 (version 4.3.1). >> >> 1. The actual version of GNAT GPL is 2010. >> 2. The version I have does not contain the text you quoted. >> 3. I don't remember this problem in the earlier versions (2008 and 2009). >> >> => My guess is that you are still using Aonix's win32ada for Ada 95. >> >> -- >> Regards, >> Dmitry A. Kazakovhttp://www.dmitry-kazakov.de > > > Little progress. The compilation is error free now. Sorry, I selected > the wrong include directory. > What is the next step to interface with the Microsoft Joystick? ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-05 15:32 ` tolkamp 2010-10-05 16:11 ` Andre @ 2010-10-05 17:03 ` Dmitry A. Kazakov 2010-10-08 8:48 ` tolkamp 1 sibling, 1 reply; 26+ messages in thread From: Dmitry A. Kazakov @ 2010-10-05 17:03 UTC (permalink / raw) On Tue, 5 Oct 2010 08:32:21 -0700 (PDT), tolkamp wrote: > What is the next step to interface with the Microsoft Joystick? Studying the MS documentation and examples on the subject: http://msdn.microsoft.com/en-us/library/dd757121%28v=VS.85%29.aspx You can either make the Windows MM system sending messages to a window and process them in the messages loop (joySetCapture), or just poll the joystick state from a tight loop in an Ada task (joyGetPosEx). P.S. This is not Ada specific, i.e. an off-topic here. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-05 17:03 ` Dmitry A. Kazakov @ 2010-10-08 8:48 ` tolkamp 2010-10-08 20:00 ` Dmitry A. Kazakov 0 siblings, 1 reply; 26+ messages in thread From: tolkamp @ 2010-10-08 8:48 UTC (permalink / raw) On 5 okt, 19:03, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de> wrote: > On Tue, 5 Oct 2010 08:32:21 -0700 (PDT), tolkamp wrote: > > What is the next step to interface with the Microsoft Joystick? > > Studying the MS documentation and examples on the subject: > > http://msdn.microsoft.com/en-us/library/dd757121%28v=VS.85%29.aspx > > You can either make the Windows MM system sending messages to a window and > process them in the messages loop (joySetCapture), or just poll the > joystick state from a tight loop in an Ada task (joyGetPosEx). > > P.S. This is not Ada specific, i.e. an off-topic here. > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de I prefer to use joyGetPosEx in an ADA task loop. On this website http://www.adapower.com/index.php?Command=Class&ClassID=Bindings&CID=388 I found the package Win32.Joystick. Is this package usable to add to my project? Regards, Fred Tolkamp ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-08 8:48 ` tolkamp @ 2010-10-08 20:00 ` Dmitry A. Kazakov 2010-10-10 11:05 ` tolkamp 0 siblings, 1 reply; 26+ messages in thread From: Dmitry A. Kazakov @ 2010-10-08 20:00 UTC (permalink / raw) On Fri, 8 Oct 2010 01:48:54 -0700 (PDT), tolkamp wrote: > On this website http://www.adapower.com/index.php?Command=Class&ClassID=Bindings&CID=388 > I found the package Win32.Joystick. Is this package usable to add to > my project? I see no problem why not. (I have no idea why win32.mmsystem still does not contain it. Maybe, because it wasn't supported under NT 4.0?) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-08 20:00 ` Dmitry A. Kazakov @ 2010-10-10 11:05 ` tolkamp 2010-10-10 11:11 ` Dmitry A. Kazakov 0 siblings, 1 reply; 26+ messages in thread From: tolkamp @ 2010-10-10 11:05 UTC (permalink / raw) On 8 okt, 22:00, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de> wrote: > On Fri, 8 Oct 2010 01:48:54 -0700 (PDT), tolkamp wrote: > > On this websitehttp://www.adapower.com/index.php?Command=Class&ClassID=Bindings&CID=388 > > I found the package Win32.Joystick. Is this package usable to add to > > my project? > > I see no problem why not. > > (I have no idea why win32.mmsystem still does not contain it. Maybe, > because it wasn't supported under NT 4.0?) > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de I have added the joystick package from the above mentioned website to win32.mmsystem.ads After compilation the next error message occurs: operator for type "Interfaces.C.unsigned_long" is not directly visable, use clause would make operation legal. The error message points to this code: JOY_RETURNALL : constant Win32.DWORD -- mmsystem.h: 2067 := ( JOY_RETURNX or JOY_RETURNY or JOY_RETURNZ or JOY_RETURNR or JOY_RETURNU or JOY_RETURNV or JOY_RETURNPOV or JOY_RETURNBUTTONS ) ; I do not understand for which package a use clause must be added. ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-10 11:05 ` tolkamp @ 2010-10-10 11:11 ` Dmitry A. Kazakov 2010-10-11 20:24 ` tolkamp 0 siblings, 1 reply; 26+ messages in thread From: Dmitry A. Kazakov @ 2010-10-10 11:11 UTC (permalink / raw) On Sun, 10 Oct 2010 04:05:51 -0700 (PDT), tolkamp wrote: > I have added the joystick package from the above mentioned website to > win32.mmsystem.ads > After compilation the next error message occurs: > operator for type "Interfaces.C.unsigned_long" is not directly > visable, use clause would make operation legal. it tells that you have to add use type Interfaces.C.unsigned_long; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-10 11:11 ` Dmitry A. Kazakov @ 2010-10-11 20:24 ` tolkamp 2010-10-12 7:25 ` Dmitry A. Kazakov 0 siblings, 1 reply; 26+ messages in thread From: tolkamp @ 2010-10-11 20:24 UTC (permalink / raw) On 10 okt, 13:11, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de> wrote: > On Sun, 10 Oct 2010 04:05:51 -0700 (PDT), tolkamp wrote: > > I have added the joystick package from the above mentioned website to > > win32.mmsystem.ads > > After compilation the next error message occurs: > > operator for type "Interfaces.C.unsigned_long" is not directly > > visable, use clause would make operation legal. > > it tells that you have to add > > use type Interfaces.C.unsigned_long; > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de Now the compilation of my project is error free. I have tried to build an executable of my project, but again an error: gnatmake -d -PC:\\GNAT\\bin\\joystick.gpr joystick_main.adb gnatbind -I- -x C:\GNAT\joystick_main.ali gnatlink C:\GNAT\joystick_main.ali -o C:\GNAT\joystick_main.exe c:/gnat/2009/bin/../libexec/gcc/i686-pc-mingw32/4.3.4/ld.exe: cannot find -lwin32ada collect2: ld returned 1 exit status gnatlink: error when calling C:\GNAT\2009\bin\gcc.exe gnatmake: *** link failed. Here the contents of the project file (joystick.gpr): project Joystick is for Source_Dirs use (".", "..\2009\include\win32ada"); for Object_Dir use "..\"; for Main use ("joystick_main.adb"); for Library_Dir use "..\2009\lib\win32ada"; end Joystick; ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-11 20:24 ` tolkamp @ 2010-10-12 7:25 ` Dmitry A. Kazakov 2010-10-12 9:52 ` tolkamp 0 siblings, 1 reply; 26+ messages in thread From: Dmitry A. Kazakov @ 2010-10-12 7:25 UTC (permalink / raw) On Mon, 11 Oct 2010 13:24:33 -0700 (PDT), tolkamp wrote: > Now the compilation of my project is error free. > I have tried to build an executable of my project, but again an error: > > gnatmake -d -PC:\\GNAT\\bin\\joystick.gpr joystick_main.adb > gnatbind -I- -x C:\GNAT\joystick_main.ali > gnatlink C:\GNAT\joystick_main.ali -o C:\GNAT\joystick_main.exe > c:/gnat/2009/bin/../libexec/gcc/i686-pc-mingw32/4.3.4/ld.exe: cannot > find -lwin32ada > collect2: ld returned 1 exit status > gnatlink: error when calling C:\GNAT\2009\bin\gcc.exe > gnatmake: *** link failed. > > > Here the contents of the project file (joystick.gpr): > > project Joystick is > for Source_Dirs use (".", "..\2009\include\win32ada"); > for Object_Dir use "..\"; > for Main use ("joystick_main.adb"); > for Library_Dir use "..\2009\lib\win32ada"; > end Joystick; You must use 'with "win32ada.gpr";' in your project: with "win32ada.gpr"; project Joystick is for Source_Dirs use ("."); for Main use ("joystick_main.adb"); package Linker is for Default_Switches ("ada") use ("-mwindows"); end Linker; end Joystick; [ And you should never use absolute paths and just any paths to any external directories. ] -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-12 7:25 ` Dmitry A. Kazakov @ 2010-10-12 9:52 ` tolkamp 2010-10-12 11:25 ` tolkamp 2010-10-12 12:07 ` Dmitry A. Kazakov 0 siblings, 2 replies; 26+ messages in thread From: tolkamp @ 2010-10-12 9:52 UTC (permalink / raw) On 12 okt, 09:25, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de> wrote: > On Mon, 11 Oct 2010 13:24:33 -0700 (PDT), tolkamp wrote: > > Now the compilation of my project is error free. > > I have tried to build an executable of my project, but again an error: > > > gnatmake -d -PC:\\GNAT\\bin\\joystick.gpr joystick_main.adb > > gnatbind -I- -x C:\GNAT\joystick_main.ali > > gnatlink C:\GNAT\joystick_main.ali -o C:\GNAT\joystick_main.exe > > c:/gnat/2009/bin/../libexec/gcc/i686-pc-mingw32/4.3.4/ld.exe: cannot > > find -lwin32ada > > collect2: ld returned 1 exit status > > gnatlink: error when calling C:\GNAT\2009\bin\gcc.exe > > gnatmake: *** link failed. > > > Here the contents of the project file (joystick.gpr): > > > project Joystick is > > for Source_Dirs use (".", "..\2009\include\win32ada"); > > for Object_Dir use "..\"; > > for Main use ("joystick_main.adb"); > > for Library_Dir use "..\2009\lib\win32ada"; > > end Joystick; > > You must use 'with "win32ada.gpr";' in your project: > > with "win32ada.gpr"; > project Joystick is > for Source_Dirs use ("."); > for Main use ("joystick_main.adb"); > package Linker is > for Default_Switches ("ada") use ("-mwindows"); > end Linker; > end Joystick; > > [ And you should never use absolute paths and just any paths to any > external directories. ] > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de- Tekst uit oorspronkelijk bericht niet weergeven - > > - Tekst uit oorspronkelijk bericht weergeven - I have changed the project file joystick.gpr with your solution. Building the executable gives the following result: gnatmake -d -PC:\\GNAT\\bin\\joystick.gpr joystick_main.adb gnatbind -I- -x C:\GNAT\bin\joystick_main.ali error: "win32-mmsystem.adb" must be recompiled ("win32-mmsystem.ads" has been modified) gnatmake: *** bind failed. Recomplilation of the package win32-mmsystem.adb results in: gnatmake -ws -c -u -PC:\\GNAT\\bin\\joystick.gpr win32-mmsystem.adb gnatmake: objects up to date. Building again results in the same error (***bind failed). ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-12 9:52 ` tolkamp @ 2010-10-12 11:25 ` tolkamp 2010-10-12 12:07 ` Dmitry A. Kazakov 1 sibling, 0 replies; 26+ messages in thread From: tolkamp @ 2010-10-12 11:25 UTC (permalink / raw) On 12 okt, 11:52, tolkamp <f.tolk...@gmail.com> wrote: > On 12 okt, 09:25, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de> > wrote: > > > > > > > On Mon, 11 Oct 2010 13:24:33 -0700 (PDT), tolkamp wrote: > > > Now the compilation of my project is error free. > > > I have tried to build an executable of my project, but again an error: > > > > gnatmake -d -PC:\\GNAT\\bin\\joystick.gpr joystick_main.adb > > > gnatbind -I- -x C:\GNAT\joystick_main.ali > > > gnatlink C:\GNAT\joystick_main.ali -o C:\GNAT\joystick_main.exe > > > c:/gnat/2009/bin/../libexec/gcc/i686-pc-mingw32/4.3.4/ld.exe: cannot > > > find -lwin32ada > > > collect2: ld returned 1 exit status > > > gnatlink: error when calling C:\GNAT\2009\bin\gcc.exe > > > gnatmake: *** link failed. > > > > Here the contents of the project file (joystick.gpr): > > > > project Joystick is > > > for Source_Dirs use (".", "..\2009\include\win32ada"); > > > for Object_Dir use "..\"; > > > for Main use ("joystick_main.adb"); > > > for Library_Dir use "..\2009\lib\win32ada"; > > > end Joystick; > > > You must use 'with "win32ada.gpr";' in your project: > > > with "win32ada.gpr"; > > project Joystick is > > for Source_Dirs use ("."); > > for Main use ("joystick_main.adb"); > > package Linker is > > for Default_Switches ("ada") use ("-mwindows"); > > end Linker; > > end Joystick; > > > [ And you should never use absolute paths and just any paths to any > > external directories. ] > > > -- > > Regards, > > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de-Tekst uit oorspronkelijk bericht niet weergeven - > > > - Tekst uit oorspronkelijk bericht weergeven - > > I have changed the project file joystick.gpr with your solution. > Building the executable gives the following result: > > gnatmake -d -PC:\\GNAT\\bin\\joystick.gpr joystick_main.adb > gnatbind -I- -x C:\GNAT\bin\joystick_main.ali > error: "win32-mmsystem.adb" must be recompiled ("win32-mmsystem.ads" > has been modified) > gnatmake: *** bind failed. > > Recomplilation of the package win32-mmsystem.adb results in: > > gnatmake -ws -c -u -PC:\\GNAT\\bin\\joystick.gpr win32-mmsystem.adb > gnatmake: objects up to date. > > Building again results in the same error (***bind failed).- Tekst uit oorspronkelijk bericht niet weergeven - > > - Tekst uit oorspronkelijk bericht weergeven - The win32ada.gpr file has the following contents: project Win32Ada is for Languages use ("ada"); for Source_Dirs use ("../../include/win32ada"); type Library_Kind is ("relocatable", "static"); Library_Type : Library_Kind := external ("LIBRARY_TYPE", "static"); for Library_Dir use "../win32ada"; case Library_Type is when "static" => for Library_Dir use Project'Library_Dir & "/static"; when "relocatable" => for Library_Dir use Project'Library_Dir & "/relocatable"; end case; for Library_Kind use Library_Type; for Library_Name use "win32ada"; for Externally_Built use "true"; end Win32Ada; ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-12 9:52 ` tolkamp 2010-10-12 11:25 ` tolkamp @ 2010-10-12 12:07 ` Dmitry A. Kazakov 2010-10-12 17:41 ` tolkamp 1 sibling, 1 reply; 26+ messages in thread From: Dmitry A. Kazakov @ 2010-10-12 12:07 UTC (permalink / raw) On Tue, 12 Oct 2010 02:52:07 -0700 (PDT), tolkamp wrote: > gnatmake -d -PC:\\GNAT\\bin\\joystick.gpr joystick_main.adb > gnatbind -I- -x C:\GNAT\bin\joystick_main.ali > error: "win32-mmsystem.adb" must be recompiled ("win32-mmsystem.ads" > has been modified) > gnatmake: *** bind failed. That should never happen because it is compiled upon installation. You probably have broken the installation of win32ada. 1. Remove GNAT GPL 2009. 2. Download and install GNAT GPL 2010 and Win32Ada from the official site. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-12 12:07 ` Dmitry A. Kazakov @ 2010-10-12 17:41 ` tolkamp 2010-10-12 20:10 ` Dmitry A. Kazakov 0 siblings, 1 reply; 26+ messages in thread From: tolkamp @ 2010-10-12 17:41 UTC (permalink / raw) On 12 okt, 14:07, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de> wrote: > On Tue, 12 Oct 2010 02:52:07 -0700 (PDT), tolkamp wrote: > > gnatmake -d -PC:\\GNAT\\bin\\joystick.gpr joystick_main.adb > > gnatbind -I- -x C:\GNAT\bin\joystick_main.ali > > error: "win32-mmsystem.adb" must be recompiled ("win32-mmsystem.ads" > > has been modified) > > gnatmake: *** bind failed. > > That should never happen because it is compiled upon installation. You > probably have broken the installation of win32ada. > > 1. Remove GNAT GPL 2009. > > 2. Download and install GNAT GPL 2010 and Win32Ada from the official site. > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de Now I have installed GNAT GPL 2010 and win32ada 2010 on my PC from site http://libre.adacore.com/libre/download2. After adding the joystick package spec from site http://www.adapower.com/index.php?Command=Class&ClassID=Bindings&CID=388 into package win32.mmsystem.asp the compilation of the project joystick is error free. Building of project gives the result: gnatmake -d -PC:\GNAT\2010\bin\joystick.gpr -XLIBRARY_TYPE=static joystick_main.adb gnatbind -I- -x C:\GNAT\2010\bin\joystick_main.ali error: "win32-mmsystem.adb" must be recompiled ("win32-mmsystem.ads" has been modified) gnatmake: *** bind failed. ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: How to interface in ADA with Microsoft joystick? 2010-10-12 17:41 ` tolkamp @ 2010-10-12 20:10 ` Dmitry A. Kazakov 0 siblings, 0 replies; 26+ messages in thread From: Dmitry A. Kazakov @ 2010-10-12 20:10 UTC (permalink / raw) On Tue, 12 Oct 2010 10:41:17 -0700 (PDT), tolkamp wrote: > Building of project gives the result: > > gnatmake -d -PC:\GNAT\2010\bin\joystick.gpr -XLIBRARY_TYPE=static > joystick_main.adb > gnatbind -I- -x C:\GNAT\2010\bin\joystick_main.ali > error: "win32-mmsystem.adb" must be recompiled ("win32-mmsystem.ads" > has been modified) > gnatmake: *** bind failed. Sorry, but it still is broken. Here is a complete working example of using joystick under GNAT Ada and Win32Ada: ---------- joystick.gpr -------------------------------------- with "win32ada.gpr"; project Joystick is for Source_Dirs use ("."); for Main use ("joystick_main.adb"); package Linker is for Default_Switches ("ada") use ("-lwinmm", "-mwindows"); end Linker; end Joystick; ---------- joystick_main.adb ------------------------------ with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Interfaces.C; use Interfaces.C; with Win32; use Win32; with Win32.MMSystem; use Win32.MMSystem; with Win32.WinUser; use Win32.Winuser; with System; use System; procedure Joystick_Main is State : aliased JOYINFO; Result : MMRESULT; Text : Unbounded_String; begin loop Text := Null_Unbounded_String; Result := joyGetPos (JOYSTICKID1, State'Unchecked_Access); if Result = JOYERR_NOERROR then Append (Text, "X =" & UINT'Image (State.wXpos)); Append (Text, "Y =" & UINT'Image (State.wYpos)); else Append (Text, "Error reading joystick state"); end if; Append (Text, Character'Val (0)); case MessageBox ( Null_Address, Addr (To_String (Text)), Addr ("Joystick position" & Character'Val (0)), MB_OKCANCEL ) is when IDOK => null; when others => exit; end case; end loop; end Joystick_Main; ------------------------------------------------------------------- The example uses joyGetPos because joyGetPosEx would not work with most of joysticks. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2010-10-12 20:10 UTC | newest] Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-10-03 15:07 How to interface in ADA with Microsoft joystick? tolkamp 2010-10-03 15:21 ` Dmitry A. Kazakov 2010-10-04 15:16 ` tolkamp 2010-10-04 16:18 ` Dmitry A. Kazakov 2010-10-04 17:54 ` tolkamp 2010-10-04 18:58 ` Dmitry A. Kazakov 2010-10-04 19:30 ` tolkamp 2010-10-04 19:46 ` tolkamp 2010-10-05 7:30 ` Dmitry A. Kazakov 2010-10-05 10:19 ` tolkamp 2010-10-05 10:55 ` AdaMagica 2010-10-05 12:21 ` Dmitry A. Kazakov 2010-10-05 15:32 ` tolkamp 2010-10-05 16:11 ` Andre 2010-10-05 17:03 ` Dmitry A. Kazakov 2010-10-08 8:48 ` tolkamp 2010-10-08 20:00 ` Dmitry A. Kazakov 2010-10-10 11:05 ` tolkamp 2010-10-10 11:11 ` Dmitry A. Kazakov 2010-10-11 20:24 ` tolkamp 2010-10-12 7:25 ` Dmitry A. Kazakov 2010-10-12 9:52 ` tolkamp 2010-10-12 11:25 ` tolkamp 2010-10-12 12:07 ` Dmitry A. Kazakov 2010-10-12 17:41 ` tolkamp 2010-10-12 20:10 ` Dmitry A. Kazakov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox