DirectX SDK |
The IDirectInputDevice7::Initialize method initializes a DirectInputDevice object. The IDirectInput7::CreateDevice method automatically initializes a device after creating it; applications normally do not need to call this method.
HRESULT Initialize( HINSTANCE hinst, DWORD dwVersion, REFGUID rguid );
It is an error for a DLL to pass the handle to the parent application. For example, an ActiveX control embedded in a Web page that uses DirectInput must pass its own instance handle, and not the handle to the Web browser. This ensures that DirectInput recognizes the control and can enable any special behaviors that may be necessary.
If the method succeeds, the return value is DI_OK or S_FALSE.
If the method fails, the return value can be one of the following error values:
DIERR_ACQUIRED |
DIERR_DEVICENOTREG |
If the method returns S_FALSE, the device had already been initialized with the instance GUID passed in though rGUID.
If this method fails, the underlying object should be considered to be in an indeterminate state and must be reinitialized before use.
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.