Platform SDK: DirectX

DirectInput.CreateDevice

The DirectInput.CreateDevice method creates and initializes an instance of a device based on a given GUID.

object.CreateDevice(guid As String) As DirectInputDevice

Parameters

object
Object expression that resolves to a DirectInput object.
guid
The instance GUID for the desired input device. The GUID is retrieved from the DirectInputDeviceInstance object returned by the DirectInputEnumDevices.GetItem method, or it can be one of the following strings:
GUID_SysKeyboard
The default system keyboard.
GUID_SysMouse
The default system mouse.

Return Values

If the method succeeds, a DirectInputDevice object is returned.

Error Codes

If the method fails, an error is raised and Err.Number may be set to one of the following:

DIERR_DEVICENOTREG
DIERR_INVALIDPARAM
DIERR_NOINTERFACE
DIERR_OUTOFMEMORY

See Also

Using GUIDs