次の方法で共有


IDebugClassField::GetEnclosingClass

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Gets the class that encloses this class.

Syntax

HRESULT GetEnclosingClass(
    IDebugClassField** ppClassField
);
int GetEnclosingClass(
    out IDebugClassField ppClassField
);

Parameters

ppClassField
[out] Returns an IDebugClassField object representing the enclosing class. Returns a null value if there is no enclosing class.

Return Value

If successful, returns S_OK; otherwise, returns an error code.

Remarks

If the class represented by this IDebugClassField object is a nested class, then the ppClassField parameter returns an IDebugClassField object representing the enclosing class. For example, given this class definition:

class RootClass {
    class NestedClass { }
};

Calling the GetEnclosingClass method on the IDebugClassField object representing the NestedClass class returns an IDebugClassField object representing the class RootClass.

See also