The IDirectInputEffect::Initialize method initializes a DirectInputEffect object.
HRESULT Initialize(
HINSTANCE hinst,
DWORD dwVersion,
REFGUID rguid
);
If the method succeeds, the return value is DI_OK.
If the method fails, the return value may be DIERR_DEVICENOTREG.
If this method fails, the underlying object should be considered to be an indeterminate state and needs to be reinitialized before it can be subsequently used.
The IDirectInputDevice2::CreateEffect method automatically initializes the effect after creating it. Applications normally do not need to call the Initialize method.
In C++ the rguid parameter must be passed by reference; in C, which does not have pass-by-reference, it must be passed by address. The following is an example of a C++ call:
lpeff->Initialize(g_hinstDll, DIRECTINPUT_VERSION, GUID_Effect);
The following shows the same call in C:
lpeff->lpVtbl->Initialize(lpeff, g_hinstDll,
DIRECTINPUT_VERSION, &GUID_Effect);
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.