GetData Method

Retrieves data from the OLE drag-and-drop DataObject object. Available at run time only.

oDataObject.GetData(nFormat | cFormat [, @ArrayName])

Parameters

nFormat| cFormat

Specifies the format of the data to retrieve. The following table lists the values for each data format and a description of each format. The DataObject automatically supports the following formats (more formats are available, but these may require additional programming to use). For more information about the data formats available, see the documentation for Visual C++® on the Microsoft Developer Network.

Data format* nFormat| cFormat Description

CF_TEXT

1

Text format.

CF_OEMTEXT

7

Text format containing characters in the OEM character set.

CF_UNICODETEXT

13

Unicode text format

NoteNote

Available only for versions of Visual FoxPro running on Windows NT 4.0 or later.

CF_FILES or CF_HDROP

15

A handle that identifies a list of files, such as a set of files dragged from the Windows Explorer.

CF_LOCALE

16

A handle to the locale identifier associated with text on the clipboard.

CFSTR_OLEVARIANTARRAY

"OLE Variant Array"

A Visual FoxPro array. Multiple values can be transferred in a single drag and drop operation with this format.

For example, this format can be used to drag a set of items in a list box to another list box.

CFSTR_OLEVARIANT

"OLE Variant"

A Visual FoxPro variant. All data types in Visual FoxPro are represented as variants. This format can be used to drag and drop Visual FoxPro data without losing the data type.

CFSTR_VFPSOURCEOBJECT

"VFP Source Object"

A reference to a Visual FoxPro object.

* Defined in FOXPRO.H.

@ArrayName

Specifies the name of the array in which the data is stored when the data can contain multiple values. The only data formats in which the data can contain multiple values are CF_FILES, CF_HDROP, and CFSTR_OLEVARIANTARRAY. For example, you can drag a set of files from the Windows Explorer onto a Visual FoxPro list box. Use the GetData method in the OLEDragDrop event of the list box to place the names of the files into an array, then use the AddItem method in a FOR ... ENDFOR loop to add the contents of the array to the list box.

The array must exist before you can specify its name in the GetData method. If the array exists and isn't large enough to contain the data, Visual FoxPro automatically increases the size of the array. If the array is larger than necessary, Visual FoxPro truncates the array.

Expand imageRemarks

Expand imageSee Also


© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic