Method DragDataObject():getData() Foundation

Returns the data encapsulated by the DragDataObject instance.

:getData( <nFormatId>   ) --> xData | NIL
:getData( <cFormatName> ) --> xData | NIL
<nFormat> is a numeric value that identifies the format of the data to be retrieved. It may be one of the following pre-defined format ids, or a custom format defined by the data provider.
Pre-defined data formats
Constant Description
XBPCLPBRD_TEXT Data in ASCII text format
XBPCLPBRD_BITMAP Graphic data in a bitmap format
XBPCLPBRD_METAFILE Graphic data in a meta file format
XBPCLPBRD_FILELIST List of files dragged over from the Windows Shell
<cFormatName> is a character string with the name of the format the data is to be retrieved in. Format names may vary with the operating system version installed, e.g. "File List", "FileName" or "Html".

:getData() returns the data encapsulated by the DragDataObject instance. Format and data type depend on the parameter passed to the method. The following table lists the data types returned for the pre-defined data formats.

Return values for pre-defined formats
Format Return Value
XBPCLPBRD_TEXT Character string
XBPCLPBRD_FILELIST Array with file names

If a private format is specified in parameter <nFormat>, :getData() returns either a character string or an operating system handle value.


The method :getData() returns the data encapsulated by an instance of the DragDataObject class. The data is returned in the format requested by the Xbase++ application. Often, the same data is available through a DragObject in several formats at once. An image may be retrieved as a bitmapped image or as a meta file. In order to determine the formats the data is available in, an application use the methog :queryGetFormat().

The files returned for format XBPCLPBRD_FILELIST may include Shell Links. Shell Link files usually have the extension ".LNK" and are generally used as a shortcut for accessing another file, the link target. In order to read the contents of file referenced via a Shell Link, the link must be derefenced first. For this purpose, the function ShellLinkResolve() may be used.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.