Share via


IDebugDocumentPositionOffset2::GetRange

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 the range for the current document position.

Syntax

HRESULT GetRange(
   DWORD* pdwBegOffset,
   DWORD* pdwEndOffset
);
public int GetRange(
   ref uint pdwBegOffset,
   ref uint pdwEndOffset
);

Parameters

pdwBegOffset
[in, out] Offset for the start position of the range. Set this parameter to a null value if this information is not needed.

pdwEndOffset
[in, out] Offset for the end position of the range. Set this parameter to a null value if this information is not needed.

Return Value

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

Remarks

The range specified in a document position for a location breakpoint is used by the debug engine (DE) to search ahead for a statement that actually contributes code. For example, consider the following code:

Line 5: // comment
Line 6: x = 1;

Line 5 contributes no code to the program being debugged. If the debugger that sets the breakpoint on line 5 wants the DE to search forward a certain amount for the first line that contributes code, the debugger would specify a range that includes additional candidate lines where a breakpoint might be correctly placed. The DE would then search forward through those lines until it found a line that could accept a breakpoint.

See also