473,804 Members | 3,953 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 lpvTypeSpecific Params), 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
.lNegativeCoeff icient = 5000
.lPositiveCoeff icient = 5000
.lOffset = 0
End With
With .conditionY
.lNegativeCoeff icient = 5000
.lPositiveCoeff icient = 5000
.lOffset = 0
End With
End With

Set di_effect = diJoystick.Crea teEffect("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 4512
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.publi c.vb.general.di scussion

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******@googl email.comschree f in bericht
news:11******** **************@ v45g2000cwv.goo glegroups.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 lpvTypeSpecific Params), 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
.lNegativeCoeff icient = 5000
.lPositiveCoeff icient = 5000
.lOffset = 0
End With
With .conditionY
.lNegativeCoeff icient = 5000
.lPositiveCoeff icient = 5000
.lOffset = 0
End With
End With

Set di_effect = diJoystick.Crea teEffect("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
6702
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 me,thank you!
0
1158
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 I found: http://www.dotnet247.com/247reference/msgs/40/202330.aspx Not sure how to write the listners for the same. Any help would be great! Thanks,
5
7867
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
2908
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
4478
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 to do it through event, i.e., when you move the joystick, it send to the app an event or message which you can hand with a handler. The old joystick API has been superseded by DirectInput, and I have read
2
2239
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
3236
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 possible, I only want to know it. In that way I would tell it inmediately to my boss... thank you
4
2422
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 managed directx9 such as XNA does not support devices with direct3d8 only, the software rasterizer works but is so mind numingly slow. Im drawing 3d objects such as surfaces with textures, created at run time for a wire mesh/model editor.
5
2307
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: g_pDI->EnumDevices(DI8DEVCLASS_GAMECTRL, EnumJoysticksCallback, NULL, DIEDFL_ATTACHEDONLY); where BOOL CALLBACK EnumJoysticksCallback(const DIDEVICEINSTANCE*
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10580
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9157
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5652
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3821
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2993
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.