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: Use version 5.0 or later.
Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Header: Declared in dinput.h.
Import Library: Use dinput.lib.