Microsoft DirectX 8.1 (Visual Basic)

DirectInput8.CreateDevice

Creates and initializes an instance of a device based on a given GUID.

object.CreateDevice(guid As String) As DirectInputDevice8

Parts

object
Resolves to a DirectInput8 object.
guid
The instance GUID for the desired input device. The GUID is retrieved from the DirectInputDeviceInstance8 object returned by the DirectInputEnumDevices8.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

Returns a DirectInputDevice8 object.

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

DirectInput8, Using GUIDs