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

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

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

uint32 VARIANT 类型应该是什么?

TIA!!

【问题讨论】:

  • 改用InitVariantFromInt32

标签: winapi com


【解决方案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.

【讨论】:

    猜你喜欢
    • 2011-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-25
    • 1970-01-01
    相关资源
    最近更新 更多