Share via


IDebugProgram2::EnumCodeContexts

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

Retrieves a list of the code contexts for a given position in a source file.

Syntax

HRESULT EnumCodeContexts( 
   IDebugDocumentPosition2*  pDocPos,
   IEnumDebugCodeContexts2** ppEnum
);
int EnumCodeContexts( 
   IDebugDocumentPosition2     pDocPos,
   out IEnumDebugCodeContexts2 ppEnum
);

Parameters

pDocPos
[in] An IDebugDocumentPosition2 object representing an abstract position in a source file known to the IDE.

ppEnum [out] Returns an IEnumDebugCodeContexts2 object that contains a list of the code contexts.

Return Value

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

Remarks

This method allows the session debug manager (SDM) or IDE to map a source file position into a code position. More than one code context is returned if the source generates multiple blocks of code (for example, C++ templates).

See also