Hi,
I'm struggling with FF for my XFX gamepad. It works but it's buggy. I'm using XP, Delphi 2006 and the latest October 2006 DX headers.
Here's my effect creation code:
[pascal] procedure CreateForceFeedbackEffect;
var
I:IDirectInputEffect;
EIEFFECT;
F:array[0..0] of DICONSTANTFORCE;
A:array[0..0] of dword;
D:array[0..0] of longint;
H:HResult;
begin
F[0].lMagnitude:=5000;
A[0]:=DIJOFS_X;
D[0]:=0;
ZeroMemory(@E,sizeof(E));
with E do
begin
dwSize:=sizeof(DIEFFECT);
dwFlags:=DIEFF_CARTESIAN or DIEFF_OBJECTOFFSETS;
dwDuration:=INFINITE;
dwSamplePeriod:=0;
dwGain:=DI_FFNOMINALMAX;
dwTriggerButton:=DIEB_NOTRIGGER;
dwTriggerRepeatInterval:=0;
cAxes:=3;
rgdwAxes:=@A;
rglDirection:=@D;
lpEnvelope:=nil;
cbTypeSpecificParams:=sizeof(F);
lpvTypeSpecificParams:=@F;
dwStartDelay:=0;
end;
if BlahBlah.CreateEffect(GUID_ConstantForce,@E,I,nil) =DI_OK then blah etc.[/pascal]
The pad rumbles for 1 second when CreateEffect is processed. There are no error messages anywhere in my code (all results are checked). I'm sure it's not normal for it to play after creation. Any ideas?
After creation I can use the Start command to start the infinite effect but Stop does nothing (even though it returns DI_OK). I have to use SendForceFeedbackCommand (DISFFC_STOPALL) to stop the rumble. Are these problems linked?
Thanks for any advice - I pulling out what little hair I have!!!
Bookmarks