Microsoft DirectX 8.1 (Visual Basic)

DirectInputDevice8.CreateEffectFromFile

Creates a force-feedback effect whose parameters are stored in a file. If the device is currently acquired at the exclusive cooperative level, the effect is also downloaded.

object.CreateEffectFromFile( _
  filename As String, _
  flags As Long, _
  effectName As String _
) As DirectInputEffect

Parts

object
Resolves to a DirectInputDevice8 object.
filename
String that specifies the file name.
flags
Flags that specify how to create the effect. Can be one or more values from the CONST_DIFEFFLAGS enumeration.
effectName
Friendly name of the effect, assigned by the author.

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 but not necessarily downloaded. In order for it to be downloaded, the device must be acquired in exclusive mode.

The file specified in the filename parameter must be in the format used by the Force Editor (Fedit.exe) application supplied with the Microsoft® DirectInput® SDK.

See Also

DirectInputEffect.Download, DirectInputDevice8.WriteEffectToFile