Microsoft DirectX 8.1 (C++)

IDirectInputDevice8::CreateEffect

Creates and initializes an instance of an effect identified by the effect GUID.

HRESULT CreateEffect(
  REFGUID rguid,                 
  LPCDIEFFECT lpeff,             
  LPDIRECTINPUTEFFECT *ppdeff,  
  LPUNKNOWN punkOuter            
);

Parameters

rguid
Reference to (C++) or address of (C) the GUID identifying the effect to be created. This can be a predefined effect GUID, or it can be a GUID obtained from IDirectInputDevice8::EnumEffects.

The following standard effect GUIDs are defined:

lpeff
DIEFFECT structure that provides parameters for the created effect. This parameter is optional. If it is NULL, the effect object is created without parameters. The application must then call the IDirectInputEffect::SetParameters method to set the parameters of the effect before it can download the effect.
ppdeff
Address of a variable to receive a pointer to the IDirectInputEffect interface if successful.
punkOuter
Controlling unknown for COM aggregation. The value is NULL if the interface is not aggregated. Most callers pass NULL.

Return Values

If the method succeeds, the return value is DI_OK.

If the method fails, the return value can be one of the following error values:

DIERR_DEVICEFULL
DIERR_DEVICENOTREG
DIERR_INVALIDPARAM
DIERR_NOTINITIALIZED

If the return value is S_OK, the effect was created, and the parameters of the effect were updated, but the effect was not necessarily downloaded. For it to be downloaded, the device must be acquired in exclusive mode.

Requirements

  Windows NT/2000/XP: Requires Windows® 2000.
  Windows 98/Me: Requires Windows 98 or later. Available as a redistributable for Windows 98.
  Header: Declared in Dinput.h.