WIM:uint32 的变体类型?

Posted

技术标签:

【中文标题】WIM:uint32 的变体类型?【英文标题】:WIM: Variant Type for uint32? 【发布时间】:2022-01-02 10:48:11 【问题描述】:

WIM/CIM 方法的定义采用输入参数“uint32”。

我使用InitVariantFromUInt32() 设置使用的变量,但IWbemClassObject::put() 抱怨WBEM_E_TYPE_MISMATCH (0x80041005)

uint32 VARIANT 类型应该是什么?

TIA!!

【问题讨论】:

改用InitVariantFromInt32 【参考方案1】:

答案在:

https://docs.microsoft.com/en-us/windows/win32/wmisdk/numbers

Data type Automation type Description
sint8 VT_I2 Signed 8-bit integer.
sint16 VT_I2 Signed 16-bit integer.
sint32 VT_I4 Signed 32-bit integer.
sint64 VT_BSTR Signed 64-bit integer in string form. This type follows hexadecimal or decimal format according to the American National Standards Institute (ANSI) C rules.
real32 VT_R4 4-byte floating-point value that follows the Institute of Electrical and Electronics Engineers, Inc. (IEEE) standard.
real64 VT_R8 8-byte floating-point value that follows the IEEE standard.
uint8 VT_UI1 Unsigned 8-bit integer.
uint16 VT_I4 Unsigned 16-bit integer.
uint32 VT_I4 Unsigned 32-bit integer.
uint64 VT_BSTR Unsigned 64-bit integer in string form. This type follows hexadecimal or decimal format according to ANSI C rules.

【讨论】:

以上是关于WIM:uint32 的变体类型?的主要内容,如果未能解决你的问题,请参考以下文章

uint和int的区别

uint8_t / uint16_t / uint32_t /uint64_t 是什么数据类型 - 大总结

Golang的数据类型

uint8_t / uint16_t / uint32_t /uint64_t 是什么数据类型 - 大总结,看完全明白了

无法使用类型为“(UInt32)”的参数列表调用类型“CGBitmapInfo”的初始化程序

uint8_t / uint16_t / uint32_t /uint64_t 这些数据类型是什么?