Microsoft DirectX 8.1 (Visual Basic)

DirectInputDevice8.CreateEffect

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

Parts

object
Resolves to a DirectInputDevice8 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 type containing the parameters for the effect.

Return Values

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_DEVICEFULL
DIERR_DEVICENOTREG
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

DirectInputDevice8.CreateEffectFromFile

DirectInputEffect.Download

DirectInputEffect.Start