J
James Hallam
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
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