Partager via


AddSegment method

Creates a highlight segment for the markup between two display pointers and highlights it according to a specified rendering style.

Syntax

HRESULT retVal = object.AddSegment(pDispPointerStart, pDispPointerEnd, pIRenderStyle, ppISegment);

Parameters

  • pDispPointerStart [in]
    Type: IDisplayPointer

    Pointer to an IDisplayPointer interface representing the start point of the segment to be highlighted.

  • pDispPointerEnd [in]
    Type: IDisplayPointer

    Pointer to an IDisplayPointer interface representing the end point of the segment to be highlighted.

  • pIRenderStyle [in]
    Type: IHTMLRenderStyle

    Pointer to an IHTMLRenderStyle interface representing the style with which to render the specified segment.

  • ppISegment [out]
    Type: IHighlightSegment

    Address of a pointer to a variable that receives an IHighlightSegment interface pointer for the interface that represents the highlight segment between pDispPointerStart and pDispPointerEnd.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Segments added for highlighting do not need to be contiguous and can be rendered in multiple styles.