ClipboardCopy Method
ClipboardCopy Method |
Copies the InkStrokes collection to the Clipboard.
Declaration
[C++]
HRESULT ClipboardCopy (
[in, optional, defaultvalue(NULL)] IInkStrokes* strokes,
[in, optional, defaultvalue(ICF_Default)] InkClipboardFormats formats,
[in, optional, defaultvalue(ICB_Default)] InkClipboardModes modes,
[out, retval] IDataObject** DataObject,
);
[Microsoft® Visual Basic® 6.0]
Public Function ClipboardCopy( _
[strokes As InkStrokes], _
[formats As InkClipboardFormats = ICF_CopyMask], _
[modes As InkClipboardModes = ICB_Copy] _
) As IDataObject
Parameters
strokes
[in, optional] Specifies the strokes to copy. If the strokes parameter is Null
, the ClipboardCopy method copies the entire InkDisp object. The default value is a NULL
pointer.
Note: In Visual Basic 6.0, this parameter cannot be omitted if late binding is used. Instead, the default value of Nothing must be explicitly specified.
formats
[in, optional] Specifies the InkClipboardFormats enumeration value of the InkDisp object. The default value is ICF_Default.
modes
[in, optional] Specifies the InkClipboardModes enumeration value of the InkDisp object. The default value is ICB_Default.
DataObject
[out, retval] Returns the newly create data object.
Return Value
HRESULT value | Description |
---|---|
S_OK | Success. |
E_POINTER | A parameter contained an invalid pointer. |
E_INK_EXCEPTION | An exception occurred inside the method. |
E_INK_MISMATCHED_INK_OBJECT | The strokes parameter is associated with a different Ink object. |
Remarks
This method copies all properties of the stroke, including recognition results. Setting the strokes parameter to NULL
copies the InkDisp object to the Clipboard, including the CustomStrokes property, and recognition results for strokes in the InkDisp object's IInkCustomStrokes collection are maintained.
If an empty InkStrokes collection is passed, the method returns NULL
and the contents of the Clipboard are not modified.
Caution: To avoid potential memory leaks as a result of using the ICB_DelayedCopy flag, you must call the OleFlushClipboard or OleSetClipboard method. This must be done before the application exits if the last call to the ClipboardCopy method used the ICB_DelayedCopy flag.
Example
[Visual Basic 6.0]
This Visual Basic 6.0 example shows a simple menu handler that copies all of the ink in the InkCollector, theInkCollector, to the Clipboard.
Private Sub menuEditCopy_Click()
theInkCollector.Ink.ClipboardCopy theInkCollector.Ink.Strokes, ICF_CopyMask, ICB_Copy
End Sub