次の方法で共有


IDebugDocumentContext2::GetSourceRange

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 source code range of this document context.

Syntax

HRESULT GetSourceRange( 
   TEXT_POSITION* pBegPosition,
   TEXT_POSITION* pEndPosition
);
int GetSourceRange( 
   TEXT_POSITION[] pBegPosition,
   TEXT_POSITION[] pEndPosition
);

Parameters

pBegPosition
[in, out] A TEXT_POSITION structure that is filled in with the starting position. Set this argument to a null value if this information is not needed.

pEndPosition
[in, out] A TEXT_POSITION structure that is filled in with the ending position. Set this argument to a null value if this information is not needed.

Return Value

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

Remarks

A source range is the entire range of source code, from the current statement back to just after the previous statement that contributed code. The source range is typically used for mixing source statements, including comments, with code in the disassembly window.

To get the range for just the code statements contained within this document context, call the GetStatementRange method.

See also