IDirectInputEffect::GetParameters
The IDirectInputEffect::GetParameters method retrieves information about an effect.
HRESULT GetParameters(
LPDIEFFECT peff,
DWORD dwFlags
);
Parameters
- peff
- Address of a DIEFFECT structure that receives effect information. The dwSize member must be filled in by the application before calling this method.
- dwFlags
- Flags specifying which portions of the effect information is to be retrieved. The value may be zero, or one or more of the following constants:
- DIEP_ALLPARAMS
- The union of all other DIEP_* flags, indicating that all members of the DIEFFECT structure are being requested.
- DIEP_ALLPARAMS_DX5
- The union of all other DIEP_* flags.
- DIEP_AXES
- The cAxes and rgdwAxes members should receive data. The cAxes member on entry contains the sizes (in DWORDs) of the buffer pointed to by the rgdwAxes member. If the buffer is too small, then the method returns DIERR_MOREDATA and sets cAxes to the necessary size of the buffer.
- DIEP_DIRECTION
- The cAxes and rglDirection members should receive data. The cAxes member on entry contains the size (in DWORDs) of the buffer pointed to by the rglDirection member. If the buffer is too small, then the GetParameters method returns DIERR_MOREDATA and sets cAxes to the necessary size of the buffer.
The dwFlags member must include at least one of the coordinate system flags (DIEFF_CARTESIAN, DIEFF_POLAR, or DIEFF_SPHERICAL). DirectInput will return the direction of the effect in one of the coordinate systems you specified, converting between coordinate systems as necessary. On exit, exactly one of the coordinate system flags will be set in the dwFlags member, indicating which coordinate system DirectInput used. In particular, passing all three coordinate system flags will retrieve the coordinates in exactly the same format in which they were set.
- DIEP_DURATION
- The dwDuration member should receive data.
- DIEP_ENVELOPE
- The lpEnvelope member points to a DIENVELOPE structure that should receive data. If the effect does not have an envelope associated with it, then the lpEnvelope member will be set to NULL.
- DIEP_GAIN
- The dwGain member should receive data.
- DIEP_SAMPLEPERIOD
- The dwSamplePeriod member should receive data.
- DIEP_TRIGGERBUTTON
- The dwTriggerButton member should receive data.
- DIEP_TRIGGERREPEATINTERVAL
- The dwTriggerRepeatInterval member should receive data.
- DIEP_TYPESPECIFICPARAMS
- The lpvTypeSpecificParams member points to a buffer whose size is specified by the cbTypeSpecificParams member. On return, the buffer will be filled in with the type-specific data associated with the effect, and the cbTypeSpecificParams member will contain the number of bytes copied. If the buffer supplied by the application is too small to contain all the type-specific data, then the method returns DIERR_MOREDATA, and the cbTypeSpecificParams member will contain the required size of the buffer in bytes.
Return Values
If the method succeeds, the return value is DI_OK.
If the method fails, the return value may be one of the following error values:
Remarks
Common errors resulting in a DIERR_INVALIDPARAM error include not setting the dwSize member of the DIEFFECT structure, passing invalid flags, or not setting up the members in the DIEFFECT structure properly in preparation for receiving the effect information. For example, if information is to be retrieved in the dwTriggerButton member, the dwFlags member must be set to either DIEFF_OBJECTIDS or DIEFF_OBJECTOFFSETS, so that DirectInput knows how to describe the button.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in dinput.h.
Import Library: Use dinput.lib.