   SetParameters for DInput fails with GUID_Sine type effect
  Hi!I'm working on a force feedback software for Logitech G940 joystick. While I'm able to accomplish what I want, one thing that disturbs me is when I create an effect of type 'GUID_Sine', as follows:DIPERIODIC dp;dp.dwMagnitude = DI_FFNOMINALMAX;dp.dwPeriod = (DWORD) (0.15 * DI_SECONDS);dp.dwPhase = 0;dp.lOffset = 0;    // Create the prepared effectrglDirection[0] = 10000;rglDirection[1] = 0;ZeroMemory( &eff, sizeof(eff) );    eff.dwSize   = sizeof(DIEFFECT);eff.dwFlags  = DIEFF_CARTESIAN | DIEFF_OBJECTOFFSETS;    eff.dwDuration    = INFINITE;    eff.dwSamplePeriod= 0;    eff.dwGain   = DI_FFNOMINALMAX;    eff.dwTriggerButton    = DIEB_NOTRIGGER;    eff.dwTriggerRepeatInterval = 0;    eff.cAxes    = g_dwNumForceFeedbackAxis;    eff.rgdwAxes = rgdwAxes;    eff.rglDirection  = rglDirection;    eff.lpEnvelope    = 0;    eff.cbTypeSpecificParams    = sizeof(DIPERIODIC);    eff.lpvTypeSpecificParams   = &dp;    eff.dwStartDelay  = 0;    if( FAILED( hr = g_pDevice->CreateEffect( GUID_Sine, &eff, &g_pShakerEffect, NULL ) ) )    {   return hr;    }is that althought I'm able to generate this effect. However, at run-time, I would want to modify this effect, so I call SetParameters() function, as follows:   LONG rglDirection[2] = { 0, 0 };   DIEFFECT eff;ZeroMemory( &eff,sizeof(eff));memset(rglDirection,0,sizeof(rglDirection));DIPERIODIC dp;dp.dwMagnitude = g_nXForce;//DI_FFNOMINALMAX;dp.dwPeriod = (DWORD) (0.15 * DI_SECONDS);dp.dwPhase = 0;dp.lOffset = 0;    ZeroMemory( &eff, sizeof(eff) );    eff.dwSize = sizeof(DIEFFECT);eff.dwFlags= DIEFF_CARTESIAN | DIEFF_OBJECTOFFSETS;    eff.cAxes  = g_dwNumForceFeedbackAxis;    eff.rglDirection= &rglDirection[0];    //eff.lpEnvelope  = 0;eff.cbTypeSpecificParams  = sizeof(DIPERIODIC);    eff.lpvTypeSpecificParams = &dp;    //eff.dwStartDelay  = 0;eff.dwGain= DI_FFNOMINALMAX;    // Now set the new parameters and start the effect immediately.    hr = g_pConstEffect->SetParameters( &eff,  DIEP_DIRECTION |DIEP_START | DIEP_TYPESPECIFICPARAMS | DIEP_GAIN);I call this SetParamters() function for other kind of effects, and they all work fine. But for this effect, I get error 'hr = E_INVALIDARG'. I tried locating what the reason for this was, and found out that if I remove 'DIEP_TYPESPECIFICPARAMS' flag, this error is removed. But doing so does not change the effect.So does anyone know how to solve this problem?Thanks all for your time!Kind regards...   
  Hello!Thanks guys for trying to see how this works, I found out what my mistake was - it was so simple I'm amazed how the heck I over looked it:I was creating effect by name: g_pShakerEffect, whereas I was calling SetParamters() function for g_pConstEffect!!!Just one of those days I guess :smile:Thanks!!!   