ICorDebugEval::CreateValue 方法

创建指定类型的值,初始值为零或 Null。

此方法在 .NET Framework 2.0 版中已过时。 请改用 ICorDebugEval2::CreateValueForType

HRESULT CreateValue (
    [in] CorElementType     elementType,
    [in] ICorDebugClass     *pElementClass,
    [out] ICorDebugValue    **ppValue
);

参数

  • elementType
    [in] 一个指定值的类型的 CorElementType 枚举值。

  • pElementClass
    [in] 指向一个 ICorDebugClass 对象的指针,该对象指定值的类(如果该类型不是基元类型)。

  • ppValue
    [out] 一个指针,它指向表示该值的 ICorDebugValue 对象的地址。

备注

CreateValue 会创建给定类型的 ICorDebugValue 对象,其唯一目的是将其用于函数求值。 此值对象可用于以参数形式传递用户常数。

如果该值的类型是基元类型,则其初始值将为零或 Null。 使用 ICorDebugGenericValue::SetValue 可设置基元类型的值。

如果 elementType 的值为 ELEMENT_TYPE_CLASS,将获取一个表示 Null 对象引用的 ICorDebugReferenceValue(在 ppValue 中返回)。 可以使用此对象向带有对象引用参数的函数求值传递 Null。 ICorDebugValue 不能设置为任何值;它将始终保留为 Null。

要求

**平台:**请参见 .NET Framework 系统要求

头文件: CorDebug.idl、CorDebug.h

**库:**CorGuids.lib

**.NET Framework 版本:**1.1、1.0

请参见

参考

ICorDebugEval 接口

ICorDebugEval2::CreateValueForType 方法

ICorDebugValue 接口