The IDirectInput::Initialize method initializes a DirectInput object. The DirectInputCreate function automatically initializes the DirectInput object device after creating it. Applications normally do not need to call this method.
HRESULT Initialize(
HINSTANCE hinst,
DWORD dwVersion
);
It is an error for a DLL to pass the handle of 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 of 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.
If the method fails, the return value may be one of the following error values:
DIERR_BETADIRECTINPUTVERSION |
DIERR_OLDDIRECTINPUTVERSION |
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.