Click here to Skip to main content
15,921,179 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHide the enable parameter field prompt in crystal report Pin
member2729-Sep-08 20:53
member2729-Sep-08 20:53 
QuestionExcel cell reference in other sheet vb.net Pin
~Khatri Mitesh~29-Sep-08 20:25
~Khatri Mitesh~29-Sep-08 20:25 
Questionweb service issue Pin
Tauseef A29-Sep-08 18:27
Tauseef A29-Sep-08 18:27 
AnswerRe: web service issue Pin
jzonthemtn30-Sep-08 1:33
jzonthemtn30-Sep-08 1:33 
AnswerRe: web service issue Pin
Rajesh Anuhya30-Sep-08 1:36
professionalRajesh Anuhya30-Sep-08 1:36 
AnswerRe: web service issue Pin
Dave Kreskowiak30-Sep-08 1:44
mveDave Kreskowiak30-Sep-08 1:44 
QuestionUSB Com emulator Port Misbehaves Pin
rfrank535629-Sep-08 14:22
rfrank535629-Sep-08 14:22 
QuestionRaw Joystick data in vb.net Pin
bfeike29-Sep-08 13:26
bfeike29-Sep-08 13:26 
Hi all,

Any help with this one very much appreciated (I've spent weeks on it (on and off) and it is driving me mad...)

I have a need to retrieve and set the raw values of a joystick (not the calibrated values returned normally). The code is written in VB.NET and uses DirectInput.
My code works at present but returns calibrated data (so a range of 0 - 65535). A snippet of the code below:

My question is: How can I retrieve (and set) the raw data values returned by each axis?

My reading did point me at IDirectInputDevice8::SetProperty, and to use the DIPROP_CALIBRATIONMODE parameter - but I can't work out how to do this in vb.net.

(In case anyone is wondering why I would not use the control panel to calibrate a joystick - I need this code as the program will manually 'calibrate' the pots out of a joystick on a DIY motion platform simulator we are building - and we wish to use joystick pots as the feedback mechanism).

Again - thanks in advance to anyone that can help.

Dim devices As Microsoft.DirectX.DirectInput.DeviceList
Dim device As Microsoft.DirectX.DirectInput.DeviceInstance
Dim Joystick As Microsoft.DirectX.DirectInput.Device
Dim JState As Microsoft.DirectX.DirectInput.JoystickState

'Get all the devices of type joystick
devices = Microsoft.DirectX.DirectInput.Manager.GetDevices(DeviceType.Joystick, EnumDevicesFlags.AllDevices)

'Do we have at least one Joystick?
[...]
devices = Microsoft.DirectX.DirectInput.Manager.GetDevices(DeviceType.Joystick, EnumDevicesFlags.AllDevices)
[...]

'Move to the first
devices.MoveNext()

'Now get the first device.
device = devices.Current

'Now get joystick handle to the device
Joystick = New Microsoft.DirectX.DirectInput.Device(device.InstanceGuid)

'Tell the joystick to behave itself as we want it to.
Joystick.SetCooperativeLevel(Me, CooperativeLevelFlags.Background + CooperativeLevelFlags.NonExclusive)

Joystick.Acquire()
Joystick.Poll()

JState = Joystick.CurrentJoystickState

Joystick.Poll()
JState = Joystick.CurrentJoystickState
TBJoyX.Value = JState.X
TBJoyY.Value = JState.Y
AnswerRe: Raw Joystick data in vb.net Pin
bfeike6-Oct-08 20:21
bfeike6-Oct-08 20:21 
QuestionIs it really possible: No access to bitmap in VB? Pin
Sonhospa29-Sep-08 11:42
Sonhospa29-Sep-08 11:42 
AnswerRe: Is it really possible: No access to bitmap in VB? [modified] Pin
Dave Kreskowiak29-Sep-08 11:58
mveDave Kreskowiak29-Sep-08 11:58 
GeneralRe: Is it really possible: No access to bitmap in VB? Pin
Sonhospa29-Sep-08 12:20
Sonhospa29-Sep-08 12:20 
GeneralRe: Is it really possible: No access to bitmap in VB? Pin
Dave Kreskowiak29-Sep-08 14:13
mveDave Kreskowiak29-Sep-08 14:13 
Questionxds Pin
postonoh29-Sep-08 11:35
postonoh29-Sep-08 11:35 
AnswerRe: xds Pin
Dave Kreskowiak29-Sep-08 11:55
mveDave Kreskowiak29-Sep-08 11:55 
QuestionAdding a string to an existing byte array Pin
Scott Barbour29-Sep-08 11:05
Scott Barbour29-Sep-08 11:05 
AnswerRe: Adding a string to an existing byte array Pin
Dave Kreskowiak29-Sep-08 11:53
mveDave Kreskowiak29-Sep-08 11:53 
AnswerRe: Adding a string to an existing byte array Pin
Guffa30-Sep-08 3:17
Guffa30-Sep-08 3:17 
GeneralRe: Adding a string to an existing byte array Pin
Scott Barbour30-Sep-08 4:39
Scott Barbour30-Sep-08 4:39 
QuestionSlow execution in VB6 whil very fast from SQL Server Query Analyzer Pin
Fadou29-Sep-08 2:00
Fadou29-Sep-08 2:00 
AnswerRe: Slow execution in VB6 whil very fast from SQL Server Query Analyzer Pin
akimba29-Sep-08 2:54
akimba29-Sep-08 2:54 
GeneralRe: Slow execution in VB6 whil very fast from SQL Server Query Analyzer Pin
Jon_Boy29-Sep-08 3:58
Jon_Boy29-Sep-08 3:58 
QuestionMerge modules for crystal reports, VS 2005 Pin
Michelange MUBERUKA28-Sep-08 23:41
Michelange MUBERUKA28-Sep-08 23:41 
AnswerRe: Merge modules for crystal reports, VS 2005 Pin
Dave Kreskowiak29-Sep-08 1:45
mveDave Kreskowiak29-Sep-08 1:45 
QuestionHelp using IMAPI2 Pin
johnjsm28-Sep-08 21:44
johnjsm28-Sep-08 21:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.