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。 使用 设置基元类型的值。

如果 elementType 的值为 ELEMENT_TYPE_CLASS,则将获取表示 null 对象引用的“ICorDebugReferenceValue”(在 ppValue 中返回)。 可以使用此对象将 null 传递给具有对象引用参数的函数计算。 不能将 ICorDebugValue 设置为任何内容;它始终保留为 null。

要求

平台:请参阅系统要求

标头:CorDebug.idl、CorDebug.h

库:CorGuids.lib

.NET Framework 版本:1.1、1.0

请参阅