IVsTextManager2::NavigateToLineAndColumn2 Method (IVsTextBuffer^, Guid, Int32, Int32, Int32, Int32, UInt32)
Finds or creates an appropriate view on the specified buffer and places the selection at the specified location.
Assembly: Microsoft.VisualStudio.TextManager.Interop.8.0 (in Microsoft.VisualStudio.TextManager.Interop.8.0.dll)
int NavigateToLineAndColumn2( IVsTextBuffer^ pBuffer, [InAttribute] Guid% guidDocViewType, int iStartRow, int iStartIndex, int iEndRow, int iEndIndex, unsigned int grfIncludeViewFrameType )
Parameters
- pBuffer
-
Type:
Microsoft.VisualStudio.TextManager.Interop::IVsTextBuffer^
[in] Pointer to the IVsTextBuffer interface.
- guidDocViewType
-
Type:
System::Guid
[in] GUID identifying the view. This value should always be LOGVIEWID_TextView.
- iStartRow
-
Type:
System::Int32
[in] Starting line for the selection to locate.
- iStartIndex
-
Type:
System::Int32
[in] Starting index for the selection to locate.
- iEndRow
-
Type:
System::Int32
[in] Ending line for the selection to locate.
- iEndIndex
-
Type:
System::Int32
[in] Ending index for the selection to locate.
- grfIncludeViewFrameType
-
Type:
System::UInt32
[in] View frame type. For more information see _VIEWFRAMETYPE
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From textmgr.idl:
HRESULT IVsTextManager2::NavigateToLineAndColumn2( [in] IVsTextBuffer* pBuffer, [in] REFGUID guidDocViewType, [in] long iStartRow, [in] CharIndex iStartIndex, [in] long iEndRow, [in] CharIndex iEndIndex, [in] VIEWFRAMETYPE grfIncludeViewFrameType );
To use this method, pass in a pointer to a text buffer and a line/column position in that buffer. The method then locates the buffer, displays a view if the view is not currently active, and then places selection at the specified span of text.