博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
DirectInput8Create
阅读量:6758 次
发布时间:2019-06-26

本文共 3846 字,大约阅读时间需要 12 分钟。

Creates a DirectInput object and returns an  or later interface.

HRESULT 				DirectInput8Create(				HINSTANCE				hinst				,				DWORD				dwVersion				,				REFIID				riidltf				,				LPVOID *				ppvOut				,				LPUNKNOWN				punkOuter				);

Parameters

hinst
Instance handle to the application or dynamic-link library (DLL) that is creating the DirectInput object. DirectInput uses this value to determine whether the application or DLL has been certified and to establish any special behaviors that might be necessary for backward compatibility. It is an error for a DLL to pass the handle to the parent application. For example, an Microsoft ActiveX control embedded in a Web page that uses DirectInput must pass its own instance handle, and not the handle to the browser. This ensures that DirectInput recognizes the control and can enable any special behaviors that might be necessary.
dwVersion
Version number of DirectInput for which the application is designed. This value is normally DIRECTINPUT_VERSION. If the application defines DIRECTINPUT_VERSION before including Dinput.h, the value must be greater than 0x0800. For earlier versions, use DirectInputCreateEx, which is in Dinput.lib.
riidltf
Unique identifier of the desired interface. This value is IID_IDirectInput8A or IID_IDirectInput8W. Passing the IID_IDirectInput8 define selects the ANSI or Unicode version of the interface, depending on whether UNICODE is defined during compilation.
ppvOut
Address of a pointer to a variable to receive the interface pointer if the call succeeds.
punkOuter
Pointer to the address of the controlling object's IUnknown interface for COM aggregation, or NULL if the interface is not aggregated. Most calling applications pass NULL. If aggregation is requested, the object returned in ppvOut is a pointer to  , as required by COM aggregation.

Return Values

If the function succeeds, the return value is DI_OK. If the function fails, the return value can be one of the following error values: DIERR_BETADIRECTINPUTVERSION, DIERR_INVALIDPARAM, DIERR_OLDDIRECTINPUTVERSION, DIERR_OUTOFMEMORY.

Remarks

The DirectInput object created by this function is implemented in Dinput8.dll. Versions of interfaces earlier than DirectX 8.0 cannot be obtained in this implementation.

To create a DirectX 8.x interface with the latest DirectX SDK without using :

  1. Set "#define DIRECTINPUT_VERSION 0x0800" before the include statement for Dinput8.h.
  2. Call DirectInput8Create instead of DirectInputCreateEx.
  3. Link to the Dinput8.lib library instead of Dinput.lib.

To create a DirectX 8.x interface with the DirectX 8.x SDK without using :

  1. Call DirectInput8Create instead of DirectInputCreateEx.
  2. Link to the Dinput8.lib library instead of Dinput.lib.

To create a DirectX 7.0 interface from the DirectX 8.x or latest DirectX SDK without using :

  1. Set "#define DIRECTINPUT_VERSION 0x0700" before the include statement for dinput.h.
  2. Call DirectInputCreateEx instead of DirectInput8Create.
  3. Link to the Dinput.lib library instead of Dinput8.lib.

To create a DirectX 7.0 interface from the DirectX 8.x or latest DirectX SDK using :

  1. Call CoInitializeEx.
  2. Call  using CLISID_DirectInput.
  3. Use IDirectInput7::Initialize to initialize the DirectInput object.

To create a DirectX 8.x or DirectX 9.0 interface from the DirectX 8.x or latest DirectX SDK using :

  1. Call .
  2. Call  using CLISID_DirectInput8.
  3. Use  to initialize the DirectInput object.

Calling the function with pUnkOuter = NULL is equivalent to creating the object through ( &CLSID_DirectInput8, punkOuter, CLSCTX_INPROC_SERVER, &IID_IDirectInput8W, lplpDirectInput), then initializing it with Initialize.

Calling the function with pUnkOuter != NULL is equivalent to creating the object through ( &CLSID_DirectInput8, punkOuter, CLSCTX_INPROC_SERVER, &IID_IUnknown, lplpDirectInput). The aggregated object must be initialized manually.

转载地址:http://zozeo.baihongyu.com/

你可能感兴趣的文章
什么是面向对象思想
查看>>
Quick-cocos2d-x3.3 Study (十六)--------- 碰撞检测,事件监听,设置掩码
查看>>
tomcat 安装
查看>>
C#调用c++创建的dll
查看>>
12.02个人博客
查看>>
Notification通知代码简洁使用
查看>>
UIView 动画
查看>>
ssh加密公私钥
查看>>
快速部署Python应用:Nginx+uWSGI配置详解
查看>>
mybatis-generator生成数据对象
查看>>
java Queue中 add/offer,element/peek,remove/poll区别
查看>>
一个继承了抽象类的普通类的执行顺序
查看>>
Map集合中key不存在时使用toString()方法、valueOf()方法和强制转换((String))之间的区别...
查看>>
ArcIMS 开发学习笔记(一)
查看>>
leetcode_1095. Find in Mountain Array_[Binary Search]
查看>>
关于搭建haddoop分布式系统的全部过程复习
查看>>
简单使用SOCKET,TCP,UDP模式之间的通信
查看>>
js历史返回
查看>>
JavaWeb之JavaMail
查看>>
430. Flatten a Multilevel Doubly Linked List - Medium
查看>>