o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

Joystick with DirectX -

I am having issues getting a joystick to work with VB.NET and directx 9. I have gotten a joystick to work in VB6 no problem with directx 8, but now with 9, I just can't get it. Here is the code I have so far:

VB Code:
  1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2.         Dim devices As Microsoft.DirectX.DirectInput.DeviceList
  3.         Dim dev As Microsoft.DirectX.DirectInput.DeviceInstance
  4.         Dim gamepadDevice As Microsoft.DirectX.DirectInput.Device
  5.         devices = Microsoft.DirectX.DirectInput.Manager.GetDevices(Microsoft.DirectX.DirectInput.DeviceClass.GameControl, Microsoft.DirectX.DirectInput.EnumDevicesFlags.AttachedOnly)
  6.         MsgBox(dev.ProductName)
  7.         gamepadDevice = New Microsoft.DirectX.DirectInput.Device(dev.ProductGuid)
  8.         gamepadDevice.RunControlPanel()
  9.         MsgBox(gamepadDevice.Caps.NumberButtons)
  10.     End Sub

The error I receive is "An unhandled exception of type 'Microsoft.DirectX.DirectInput.DeviceNotRegisteredException' occurred in microsoft.directx.directinput.dll Additional information: Error in the application."

Any thoughts? How do I register the device in directinput? I cannot figure out what is wrong, if anyone can even point me to ANY VB.NET examples for directinput, that would help greatly. I have found some examples for C/C#, but none for VB.NET. I got what I have so far by trying to take a C example and port it into VB.

I don't know how to get a device registered with directinput. PLEASE help!!

BTW if you know how to get a joystick to work with directx 8 and VB.NET, that might also help. I am not stuck on directx 9, but I am having lots of trouble with the code I had for VB6/directx 8 in .NET, because of the "As Any" types that were allowed in VB6 but are not in .NET. They were changed to System.IntPtr and I have no idea what that type even is, let alone how to get the deadzone's System.IntPtr for example! Ahhh, I am new to .NET and already having so many issues!

 

directx - create an effect to send back to joystick -
Hi All, I have managed to read from my usb joystick ok using directx apis. I am struggling trying to send an effect back - a rumble for example - using the createeffect function. Does anybody have any examples of creating an effect, or any further info that I can look at? Many


[2005] Need some DirectX with VB help please. -
Hiya, I've been trying to hunt down a routine, or some help, on the web in relation to DirectInput using DirectX 9.0c and Visual Basic 2005, but I'm having no luck. I know I could probably just "ask" for the routine, but that doesn't really help me either, as I would like


Scrolling through a listview with a joystick -
I know of the joystick API calls, but have no idea how to assign joystick movents. What I want is, when the user moves the joystick up/down, the selected item in the listview moves accordingly. Thanks.


Looking for a joystick example in VB .NET -
Hi, Does anyone have an example of use of a joystick in VB .NET or know where to find one? DirectInput or not...it doesn't matter. I'm just trying to use a USB joystick within my program. I don't care how I do it. Thanks, Bill


keyboard vs joystick: how to detect 1 by 1 -
i want to detect 2 devices, keyboard n the joystick. i just want to make sure that when the key pressed on the keyboard ( i use keydown_event ), the program won't detect the joystick; n the joystick moved ( joystick_move event ), temporary won't detect the keyboard. which command


Built in Joystick port -
On my Onboard Joystick port, whatever Joystick I use one button is ALWAYS pressed? What can/should i do? THanks, Help appreciated


[VB]simulate a joystick movement with a VB program -
hi .. I need some help in VB. I have a joystick that connected to my PC and works perfect. I want to make a program that will control on my Joystick. I want information on how to simulate a joystick movement with a VB program. thanks...


How do I avoid getting a JOYERR_UNPLUGGED -
Don't bother saying "plug a joystick in"! The PC must be polling the joystick port to see a joystick is there. Any idea what it looks for? Thanks


Joystick Problem. No Idea Whats Wrong Here -
I've been using this joystick for a while with no problems. I restart my computer one day, and Windows detects its axis but not the buttons. It ignores buttons I press as if it doesn't detect them. I'm using a standard game port joystick so it shouldn't need drivers. Any ideas?


Reading joystick / 360 game pad -
Hello all, I'm using VB5. I have written a program (AutoJoy) that allows an analog joystick to be used in Far Cry. I'm trying to write a version for the 360 game pad. Problem is, I don't have one (I use a flight yoke with three analog axes). I use this to read the three analog ax


Simple Joystick Control -
Okay, maybe this joystick idea won't crash Windows 2000... I am looking for something really simple... A code that makes the joystick mimic the keyboard keys Up, Down, Left, Right, Enter and Space. No need of fancy crosshairs or anything. I will worry about fancy when it detects


standard joystick code crashes on windows 2000 -
Anybody tried to detect the x and y of a joystick on windows 2000 using the joygetpos or joygetposex api calls? Code that runs fine on all other versions will crash vb completely without a peep. Try it youself with Microsoft's own sample VB code: http://support.microsoft.com/d


New Programmer- joystick use -
Hi I have been programming for a about 3 months now, and am ready to get some joystick functionality. I have a Microsoft sidwinder precision pro, with its included .ocx (swppro.ocx). Can anyone point me to a site with some useful information on how to use this control? I guess the f


MIDI In Out (Joystick Port) -
Hi, Can anyone tell me how I can get VB to deal with MIDI data from the joystick port? I've got a really old midi synth (Yamaha DX5) for which no editor program exists, and so I'd like to have a shot at writing my own. Just can't imagine how one would go about sending/receiving inf


joystick controller -
i'm looking for something simple the game/program i'm creating i want my joystick to do simple tasks how do i get my program to recieve and understand what my joystick is doing ex up, down, left, right, button a, button b... and so on the simpler the better


need a joystick detection's program -
this is my 2nd post oledi!! can someone plis help me to write a joystick detection's program. i just need to detect the joystick from gameport and the left, right, up and down 4 movements only, that's o!! plis, i really appreciate ur help. thanx!!!!!


VB.NET Joystick code -
Does anyone know how to read in the joystick and button presses in .net?? I cannot find any information on the web about it. Thanks J


help! joystick detection! urgent!! -
how to write a program that can detect the joystick and show the movements?!!!!! plis help!!!! lots of thanx!!!!!!!!!!!!


Joystick -
how can i interface with the joystick port?


Gameport With VB and NT -
This has been giving me hell for awhile now. I'm rewriting a program from VBDos to VB6, and it incorporates a pedal control hooked up to the gameport. Well, since I have no driver for the pedal, I'm using the WinNT generic joystick driver. I've downloaded an OCX joystick control fro


Gathering Input From Game Controllers -
How would I go about gathering input from a joystick or other game controller that has been installed onto my coputer as a game device? Perhaps a trigger to control a slider, buttons for buttons, thumbstick pisition. I know there has to be a way, I just don't exactly know how to comp


[2008] Beginner - How can I set joystick axis values -
Hi, first post! I'm just starting out with VB2008 Express Edition. I'm coming from PHP and have no prior experience with VB. I have a relatively simple question that I know I'm not going to find in my VB beginners book. I already have in mind what I want to build for my first piece


Joystick with DirectX -
I am having issues getting a joystick to work with VB.NET and directx 9. I have gotten a joystick to work in VB6 no problem with directx 8, but now with 9, I just can't get it. Here is the code I have so far: VB Code: Private Sub Form1_Load(ByVal sender As System.Object,


Joystick things -
How can I get values of min and max values for x and y coordinates? I can't use DirectX so have to be API. I found a couple of functions, joyGetPos, joyGetPosEx, joyGetDevCaps or something like that. The Caps thingy seems to be what I need but all I can get with it is the driver nam


Joystick Code -
I am looking for VB.Net Joystick code to read in button presses. I cannot find anything online. Any help would be appreciated. Thanks J


Joystick control -
I'm desperately trying to make sense out of a VB joystick tutorial at the following web address: http://msdn.microsoft.com/library/ps...ditut_9jky.htm I've modified it slightly because I don't need to use a list box for my joystick, because I'm in a controled environment. So my


VB and DirectX -
I am running on NT and would like to develop something in DirectX, but when I go to install DirectX it says that NT lacks some system stuff, and I will not have all the power of DirectX at my fingertips. Does anyone have idea what limitations I will have by being on NT?


problem with joystick code -
Hello. i have been working on a project lately to allow me to control my mouse with my joypad. i know there are a ton of programs available out there that already do this, but i wanted to make my own version of it my way. now i had the main part working fine, the mouse would move in th


learning DirectX -
Im wanna learn how to make DirectX programmes. Can anyone please tell me if there is any www site for teaching DirectX(I've never even seen a DirectX programme so I need something for total beginners). Thanx in advance


JoyStick Access -
I have a USB device that looks like a JoyStick to WinXP. How do I get access to it via VB6. I can go into the Control Panel and see it and exercise the buttons Inputs and see them change. Now I need to access them from my VB6 program.


New to DirectX -
I'm very new to DirectX, and I'm looking for a good place to start learning. I have no trouble finding 3D engines or examples of how to use DirectX, I just can't find any that are commented. Can anybody point in me in the right direction. I'm interested in all of DirectX.


about joystick struture -
that's true that depending on pc, the joystick struture can have different values? thanks


DirectX for VB -
I notice somewhere on website, it has some tutorial on implementing directX codes for VB, can remember what site address was anyone? What does directX give an effect to VB would that prevent shuttering? (especially redrawing a picture) what is good about directX with VB?


Joystick Mapping to The Mouse (Managed) -
Here is the deal. I have the Joystick class all ready to go from Direct X. However that is not the problem. The problem is how do I map the joystick controls to the mouse. Moving the mouse cursor is easy by using Me.Cursor.Position = New Point(x,y). The thing I can't figure out is how


joystick_event -
Is there an api function similar to mouse_event but for an analogue joystick? We have designed a non-contacting industrial joystick that operates with the CanBus protocol and thought it would be a laugh if we could we could play games with it. What would be ideal is if we could write


For those who play BZFlag(Free 3D Tank Game) -
I created an addon that allows you too use the joystick. Most of you people could write it in 5 min. This will calibrate any joystick correctly. Sorry that it has a setup file, its out there for the average user and uses a non-standerd ActiveX-Or 2. Have fun!! You can BZFlag:


How to make a weather station out of an old joystick... -
1. Take the stick apart and strip all the electronics out of it. Throw the chassis away or use it as an unusual garden ornament. 2. With the internals: replace the buttons and potentiometers (the sliding or rotating motion sensors) with things like electronic temperature sensors, l


DirectX 8 -
Has anyone heard if directX support for vb is going to be a little more robust(I mean as in the different calls and methods u can use and also documentation)? I was kind of dissapointed with directx 7 support. Also, are there any directx for vb books coming down the pipe?


DIRECTX version using DirectX SDK -
i have downloaded the DirectX SDK and have developed and applkication to discover my graphics cards info such as manufacturer, RAM and so on.... but the thing i'm really stuck on is discovering the DirectX version can anyone help here?


Directx in VB or C++ -
Hey everyone. I have been told by many people that directx for c++ has way more features than directx for VB. I am learning directx for VB but I was wondering if I was just waisting my time and should learn it for C++ instead. Are there more features for the C++ version?