DirectInput8Create

简介:

Creates a DirectInput object and returns an IDirectInput8 Interface 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  IUnknown, 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 CoCreateInstance:

  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 CoCreateInstance:

  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 CoCreateInstance:

  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 CoCreateInstance:

  1. Call CoInitializeEx.
  2. Call CoCreateInstance 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 CoCreateInstance:

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

Calling the function with pUnkOuter = NULL is equivalent to creating the object through CoCreateInstance( &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 CoCreateInstance( &CLSID_DirectInput8, punkOuter, CLSCTX_INPROC_SERVER, &IID_IUnknown, lplpDirectInput). The aggregated object must be initialized manually.

目录
相关文章
|
Prometheus 监控 前端开发
性能测试基础知识
性能测试基础知识
449 0
|
4月前
|
消息中间件 运维 监控
双十一前夜的"惊魂 30 秒":我的 1688 代采系统抗住 10 倍流量的架构演进之路
本文讲述一位跨境电商系统架构师老王,面对1688代采系统在业务爆发(月单量从1万增至8万)下屡次崩溃的困境,历经三次架构演进:从单体Django“能跑就行”,到引入RabbitMQ异步解耦,最终依托阿里云RocketMQ、Redis企业版、API网关等构建高可用体系,成功扛住双十一15000 QPS峰值。真实、硬核、可复用。
386 4
|
Ubuntu 安全 Linux
ubuntu2404 Server扩展PV
通过以上步骤,你可以成功扩展Ubuntu 24.04 Server上的物理卷。该过程包括创建新分区、将其添加到现有PV、扩展逻辑卷和相应的文件系统。扩展完成后,服务器将能够使用新增的存储空间,确保系统运行更加高效和稳定。
689 77
|
5月前
|
JSON Java fastjson
java工具:《jsonObject转map》
java工具:《jsonObject转map》
387 0
|
6月前
|
数据采集 人工智能 监控
快速接入小红书API,市场趋势与热点预测
小红书API+AI已成2026年品牌营销与内容电商核心基建,支持竞品监测、舆情预警、趋势预测等全场景合规数据采集;多模态生成、预测型AI与垂直领域模型加速商业化落地,SaaS工具、代运营、技术基建成三大机遇。(239字)
1433 2
|
6月前
|
人工智能 IDE 机器人
给阿里产品团队的真心话:千问很强,但我们需要它能“干活”!
作为一名一线程序员,建议千问尽快打通项目目录读取功能,并实现手机电脑端同步,做真正能干活的AI工具。
|
应用服务中间件 Nacos nginx
黑马头条_SpringCloud项目阶段一:环境搭建(Mac版本)
本文为 Mac 用户介绍微服务项目环境搭建,含阿里云服务器用 Docker 装 Nacos 1.2.0,本地通过 brew 装 OpenJDK 8、Maven 3.6.1、Redis,Docker 部署 MySQL 5.7 并配字符集,及 Nginx 安装与反向代理设置,附命令与配置步骤。
787 4
黑马头条_SpringCloud项目阶段一:环境搭建(Mac版本)
|
缓存 负载均衡 应用服务中间件
nginx的配置文件详解
本文详细解释了nginx配置文件中的关键指令和区块,如http、server、location、upstream、events等,并通过一个示例配置文件展示了如何设置HTTP服务器、gzip压缩、反向代理、URL重写、错误页面和负载均衡等,强调了配置的灵活性和实际应用。
1388 4
|
机器学习/深度学习 存储 人工智能
压缩大型语言模型(LLMs):缩小10倍、性能保持不变
尽管大规模语言模型(LLMs)在多种应用场景中表现出色,但其庞大的规模也带来了实际部署难题。本文探讨了通过模型压缩技术解决这些问题的方法,介绍了量化、剪枝和知识蒸馏三种主要压缩技术,并通过具体Python代码示例展示了如何将一个100M参数的文本分类模型压缩至52.8M参数,再通过4位量化进一步减小至原来的1/7,同时保持甚至提升性能。示例代码展示了从数据预处理、模型训练到评估的完整流程,证明了压缩技术的有效性。
1244 6
|
存储 监控 安全
HarmonyOSNext支付全栈攻略:IAP Kit无漏单秘籍+避坑指南
本文详解HarmonyOS Next应用内支付全栈开发,涵盖IAP Kit商品类型、促销配置、购买流程、发货避坑及补发机制,提供ArkTS代码示例与避坑指南,适合教育科普类开发者学习参考。

热门文章

最新文章