Freigeben über


Remove Method [IInkCustomStrokes Interface]

Remove Method [IInkCustomStrokes Interface]

Removes the InkStrokes collection from the IInkCustomStrokes collection.

Declaration

[C++]

HRESULT Remove (
    [in] VARIANT Identifier
);

[Microsoft® Visual Basic® 6.0]

Public Sub Remove( _
    Identifier _
)

Parameters

Identifier

[in] The name or index of the collection of strokes to remove from the collection of custom strokes.

For more information about the VARIANT structure, see Using the Automation Library.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER A parameter contained an invalid pointer.
E_OUTOFMEMORY Cannot allocate memory to complete the operation.
E_INK_EXCEPTION An exception occurred inside the method.
E_INK_INCOMPATIBLE_OBJECT Invalid input parameter.
E_INK_MISMATCHED_INK_OBJECT The InkDisp object of the InkStrokes collection and the IInkStrokeDisp object don't match.
E_FAIL An unspecified error occurred.
DISP_E_TYPEMISMATCH An invalid variant was passed in.

Remarks

IInkCustomStrokes collections are sets of references to ink data and are not the actual data itself. This method removes only the collection of strokes from a snapshot of, or reference to, the data and does not remove the actual ink data. To delete the collection from the actual ink data, call the DeleteStrokes method of the InkDisp object.

The Identifier parameter can be either a BSTR or a long. Use a BSTR for the name originally given to the custom stroke when it was added to the collection, and use a long for the index of the custom stroke in the collection. To specify the name of the custom stroke when you are using late binding, such as when you dimension a variable as type Object in Visual Basic 6.0 or when you use a scripting language, you must either dimension the argument variable as a String (Visual Basic 6.0), or pass in the argument as a string literal and not use a variable (script).

For more information about the BSTR data type, see Using the Automation Library.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example shows how a named set of custom strokes are added and removed.

Dim theCustomStrokes As IInkCustomStrokes
Set theCustomStrokes = theInkCollector.Ink.CustomStrokes
theCustomStrokes.Add "OriginalStrokes", theInkCollector.Ink.Strokes
' ...Do other operations in between...
theCustomStrokes.Remove "OriginalStrokes"

Applies To