Jump to content

DrgQueryTrueType

From EDM2

This function obtains the true type of a dragged object.

Syntax

DrgQueryTrueType(pditem, cbBuffer, pBuffer)

Parameters

pditem (PDRAGITEM) - input
Pointer to the DRAGITEM structure whose type is to be obtained.
cbBuffer (ULONG) - input
Maximum number of bytes to copy to pBuffer. Must be > 0.
pBuffer (PSZ) - output
Buffer in which the null-terminated string is to be returned.

Returns

rc (BOOL) - returns
Success indicator.
TRUE - Successful completion.
FALSE - Error occurred.

Remarks

The true type of an object is the first type in the string referenced by hstrType in the DRAGITEM structure. This function can be called after calling the DrgQueryTrueTypeLen function. If the type string for the object is NULLHANDLE, FALSE is returned.

Errors

Possible returns from WinGetLastError:

PMERR_INVALID_PARAMETERS (0x1208)
An application parameter value is invalid for its converted PM type. For example: a 4-byte value outside the range -32 768 to +32 767 cannot be converted to a SHORT, and a negative number cannot be converted to a ULONG or USHORT.

Example Code

This example shows how to obtain the true type of an object.

#define INCL_WINSTDDRAG /* Direct Manipulation (Drag) Functions */
#include <OS2.H>

BOOL     fSuccess; /* Return value                               */
DRAGITEM Dragitem; /* DRAGITEM structure whose true type        */
                   /* is to be obtained                          */
char     szBuffer[32]; /* Buffer in which the null-terminated     */
                      /* string is to be returned               */

fSuccess = DrgQueryTrueType(&Dragitem,
                            sizeof(szBuffer),
                            szBuffer);

Related Functions