Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use joyGetPos
Message
From
30/12/2012 10:18:16
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
How to use joyGetPos
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01560907
Message ID:
01560907
Views:
119
DECLARE integer joyGetNumDevs IN winmm
?joyGetNumDevs() && returns 16 (=driver can hold 16 joysticks)

DECLARE long joyGetPos IN winmm.dll long device, string@ joyinfo
lcjoyinfo=replicate([ ],4)
?joygetpos(0,@lcjoyinfo) && returns 165 bad parameters...
...
?joygetpos(15,@lcjoyinfo) && returns 165 bad parameters...

I saw in the example of MSDN (for C++) that joyinfo parameter is a 4 entry structure.
How to code this structure into VFP?
Does the 165 mean something else ( i.e. no joystick is conected...)??

My joystick is an old simple one with 2 axies and 2 buttons and connected to a USB port thru a 15pin-to-USB cable.

My target is to identify which joystick button is pressed.
Next
Reply
Map
View

Click here to load this message in the networking platform