Microsoft DirectX 8.1 (Visual Basic)

DirectInputEffect.Start

Begins playing an effect. If the effect is already playing, it is restarted from the beginning. If the effect has not been downloaded or has been modified since its last download, then it will be downloaded before being started. This default behavior can be suppressed by passing the DIES_NODOWNLOAD flag.

object.Start(iterations As Long, flags As Long)

Parts

object
Resolves to a DirectInputEffect object.
iterations
Number of times to play the effect in sequence. The envelope is re-articulated with each iteration.

To play the effect exactly once, pass 1. To play the effect repeatedly until explicitly stopped, pass -1. To play the effect until explicitly stopped without re-articulating the envelope, modify the effect parameters with the DirectInputEffect.SetParameters method and change the lDuration member of DIEFFECT to -1.

flags
Flags from the CONST_DIESFLAGS enumeration that describe how the effect should be played by the device. The value can be zero or one or more flags.

Error Codes

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

DIERR_INVALIDPARAM
DIERR_INCOMPLETEEFFECT
DIERR_NOTEXCLUSIVEACQUIRED
DIERR_NOTINITIALIZED
DIERR_UNSUPPORTED

Remarks

The device must be acquired at the exclusive cooperative level for this method to succeed.

Not all devices support multiple iterations.