473,385 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

VB6, DirectX8, DirectInput, Joystick Force Feedback, Conditional Effect

Hi,

I'm having trouble getting a conditional force (namely friction) using
VB6. I have had no problem using constant or periodic forces. The
trouble seems to be that when defining the later you can use...

Dim FrictionEffect As DIEFFECT

and then just define the details of the force later on, and then use
ForceEffect when Starting the force.

The problem I'm having with conditional forces is that firstly when
you use DIEFFECT it comes up with an error "Invalid Procedure Call or
Argument". If I try and use DICONDITION when defining the
FrictionEffect, the progrma won't run because I am using the wrong
type of variable.

Is there something I am forgetting or do I have to relate DICONDITION
to DIEFFECT (although this would seem strange as I didn't have to do
this for DIPERIODIC).

I read on microsofts help pages (http://msdn2.microsoft.com/en-us/
library/bb219645.aspx) that there should be some more members of
DIEFFECT (namely lpvTypeSpecificParams), although the help they give
is for C++ not VB6 so I don't know how relevent it is.

Here is the code that fails....

With FrictionEffect
With .conditionX
.lNegativeCoefficient = 5000
.lPositiveCoefficient = 5000
.lOffset = 0
End With
With .conditionY
.lNegativeCoefficient = 5000
.lPositiveCoefficient = 5000
.lOffset = 0
End With
End With

Set di_effect = diJoystick.CreateEffect("GUID_Friction",
FrictionEffect) <-- This Line
di_effect.Start 1, 0

Any help would be greatly apprieciated as I am close to pulling my
hair out!
Cheers!
James Hallam

Feb 17 '07 #1
2 4484
James,

This is a VB.NET newsgroup

Any VB 6 questions are better asked at http://www.developerfusion.com
because there are literally 1000's of people who will answer you quickly

--
Newbie Coder
(It's just a name)
Feb 17 '07 #2
James,

For VB6 questions exist all for years the Microsoft newsgroup
Microsoft.public.vb.general.discussion

It is certainly one of the most active boards about VB6.

There are from the best VB6 experts active.

http://groups.google.com/group/micro...nk=gschg&hl=en

The threads of that newsgroup are important in other boards.

Cor

"James Hallam" <ja******@googlemail.comschreef in bericht
news:11**********************@v45g2000cwv.googlegr oups.com...
Hi,

I'm having trouble getting a conditional force (namely friction) using
VB6. I have had no problem using constant or periodic forces. The
trouble seems to be that when defining the later you can use...

Dim FrictionEffect As DIEFFECT

and then just define the details of the force later on, and then use
ForceEffect when Starting the force.

The problem I'm having with conditional forces is that firstly when
you use DIEFFECT it comes up with an error "Invalid Procedure Call or
Argument". If I try and use DICONDITION when defining the
FrictionEffect, the progrma won't run because I am using the wrong
type of variable.

Is there something I am forgetting or do I have to relate DICONDITION
to DIEFFECT (although this would seem strange as I didn't have to do
this for DIPERIODIC).

I read on microsofts help pages (http://msdn2.microsoft.com/en-us/
library/bb219645.aspx) that there should be some more members of
DIEFFECT (namely lpvTypeSpecificParams), although the help they give
is for C++ not VB6 so I don't know how relevent it is.

Here is the code that fails....

With FrictionEffect
With .conditionX
.lNegativeCoefficient = 5000
.lPositiveCoefficient = 5000
.lOffset = 0
End With
With .conditionY
.lNegativeCoefficient = 5000
.lPositiveCoefficient = 5000
.lOffset = 0
End With
End With

Set di_effect = diJoystick.CreateEffect("GUID_Friction",
FrictionEffect) <-- This Line
di_effect.Start 1, 0

Any help would be greatly apprieciated as I am close to pulling my
hair out!
Cheers!
James Hallam

Feb 17 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: shrinerain | last post by:
Hello everyone,I want to use a joystick to control my computer, I know DirectInput can do this job,but I can't find any example.Do you have an example that use DirectInput in C#? Please help...
0
by: sri_san | last post by:
I am new to directx API and looking to make it work with C#. I was able to get the state of joystick by polling it at regular intervals. I am trying to make it work based on events. Here is a link...
5
by: Steve | last post by:
does anyone know where i can find an example of directinput for a joystick on VB.NET. all the examples i can find apply to vb 6.0. Thanks Steve
5
by: paulo | last post by:
Can anyone please tell me how the C language interprets the following code: #include <stdio.h> int main(void) { int a = 1; int b = 10; int x = 3;
2
by: Vicente Nicolau | last post by:
Hello, I'm implementig a C# app in which I need to access to a Joystick. Nowadays I'm using the DirectInput class for getting the actual joystick position, but trhough polling. I would like...
2
by: Vicente Nicolau | last post by:
Is there any way to recieve events from a joystick and to hadle them using C#??? Without using pulling.... Thanks.
1
by: Vicente Nicolau | last post by:
All example codes I found with DirectX or XNA access the joystick by pulling... ?? is there anybody who has been able to use the joystick with events (with C#)?? Is it possible? If it is not...
4
by: colin | last post by:
Hi, Is there an easy way to do 3d drawing using drect3d8 devices in c# ? please dont suggest using directx9 unless there is a way to use directx9 on devices with only direct3d8 support. the...
5
by: 200dogz | last post by:
I'm trying to use DirectInput in the DirectX SDK to do USB reading (a device as joystick). There's no error when compiling the codes but whenever it tries to excecute: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.