Retrieves data from the OLE drag-and-drop DataObject object. Available at run time only.
oDataObject.GetData(nFormat | cFormat [, @ArrayName])
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, available only under 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.
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.
The value returned by the GetData method is determined by the format of the data specified with nFormat or cFormat. False (.F.) is returned if the DataObject doesn't contain data in the format you specify with nFormat or cFormat. True (.T.) is returned when the data is in a multiple value format such as CF_FILES, CF_HDROP, or CFSTR_OLEVARIANTARRAY. The data on the DataObject is returned when the data is in a single value format such as CF_TEXT, CFSTR_OLEVARIANT, or CFSTR_VFPSOURCEOBJECT.
The OLESetData event for a drag source is triggered if the data format you specify with nFormat or cFormat exists, but there is no data in the DataObject for that format. (The SetFormat method can be used to specify a data format before the corresponding data is placed on the DataObject with the SetData method.)
Applies To: DataObject Object