Partilhar via


ICorDebugType::GetStaticFieldValue Method

Gets an interface pointer to an ICorDebugValue Interface that contains the value of the static field referenced by the specified field token in the specified stack frame.

HRESULT GetStaticFieldValue (
    [in] mdFieldDef          fieldDef,
    [in] ICorDebugFrame      *pFrame,
    [out] ICorDebugValue     **ppValue
);

Parameters

Parameter Description

fieldDef

[in] An mdFieldDef token that specifies the static field.

pFrame

[in] A pointer to an ICorDebugFrame Interface that represents the stack frame.

ppValue

[out] A pointer to the address of an ICorDebugValue Interface that contains the value of the static field.

Remarks

The GetStaticFieldValue method may be used only if the type is ELEMENT_TYPE_CLASS or ELEMENT_TYPE_VALUETYPE, as indicated by the ICorDebugType::GetType Method method.

For non-generic types, the operation performed by GetStaticFieldValue is identical to calling ICorDebugClass::GetStaticFieldValue Method on the ICorDebugClass Interface object that is returned by ICorDebugType::GetClass Method.

For generic types, a static field value will be relative to a particular instantiation. Also, if the static field could possibly be relative to a thread, a context, or an application domain, then the stack frame will help the debugger determine the proper value.

Remarks

GetStaticFieldValue can be used only when a call to ICorDebugType::GetType Method returns a value of ELEMENT_TYPE_CLASS or ELEMENT_TYPE_VALUETYPE.

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: CorDebug.idl

Library: CorGuids.lib

.NET Framework Version: 2.0

See Also

Reference

ICorDebugType Interface