Platform SDK: DirectX

DirectInputDevice.CreateEffect

The DirectInputDevice.CreateEffect method creates a force-feedback effect. If the device is currently acquired at the exclusive cooperative level, the effect is also downloaded.

object.CreateEffect(effectGuid As String, _
  effectinfo As DIEFFECT) As DirectInputEffect

Parameters

object
Object expression that resolves to a DirectInputDevice object.
effectGuid
String representation of a GUID for an effect recognized by the hardware driver, or one of the following aliases for standard effects:

GUID_ConstantForce
GUID_RampForce
GUID_Square
GUID_Sine
GUID_Triangle
GUID_SawtoothUp
GUID_SawtoothDown
GUID_Spring
GUID_Damper
GUID_Inertia
GUID_Friction

effectinfo
DIEFFECT structure containing the parameters for the effect.

Return Values

If the method succeeds, the method returns a DirectInputEffect object.

Error Codes

If the method fails, an error is raised and Err.Number may be one of the following error codes:

DIERR_DEVICENOTREG
DIERR_DEVICEFULL
DIERR_INVALIDPARAM
DIERR_NOTINITIALIZED

Remarks

If no error is raised, the effect was created and the parameters of the effect were updated, but the effect was not necessarily downloaded. In order for it to be downloaded, the device must be acquired in exclusive mode.

See Also

DirectInputEffect.Download, DirectInputEffect.Start