IDebugHostField2::GetLocation 方法 (dbgmodel.h)

对于具有地址的字段,而不考虑特定类型实例(例如其位置类型指示 LocationStatic 的字段),GetLocation 方法将返回字段的抽象位置(地址)。

如果给定字段没有静态位置,GetLocation 方法将失败。

语法

HRESULT GetLocation(
  Location *location
);

参数

location

字段的抽象位置(例如:地址)将在此处返回。

返回值

此方法返回 HRESULT,指示成功或失败。

言论

示例代码*

ComPtr<IDebugHostField> spField; /* get a field symbol (see EnumerateChildren) */

Location fieldLocation;
if (SUCCEEDED(spField->GetLocation(&fieldLocation)))
{
    // For fields which have a static location as determined by GetLocationKind, 
    // the location of the field will be in fieldLocation.
}

要求

要求 价值
标头 dbgmodel.h

另请参阅

IDebugHostField2 接口