Jump to content

DrgVerifyType

From EDM2
Revision as of 05:17, 8 April 2025 by Iturbide (talk | contribs) (Created page with "This function verifies whether a given type is present in the list of types defined for a drag object. ==Syntax== DrgVerifyType(pDragitem, pType) ==Parameters== ;pDragitem (PDRAGITEM) - input: Pointer to the DRAGITEM structure whose hstrType is to be verified. ;pType (PSZ) - input: String specifying the types to search for. This string is in the format: type[,type...] ==Returns== ;rc (BOOL) - returns: Success indicator. :: TRUE - Successful completion. :: FALSE -...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function verifies whether a given type is present in the list of types defined for a drag object.

Syntax

DrgVerifyType(pDragitem, pType)

Parameters

pDragitem (PDRAGITEM) - input
Pointer to the DRAGITEM structure whose hstrType is to be verified.
pType (PSZ) - input
String specifying the types to search for. This string is in the format: type[,type...]

Returns

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

Remarks

If at least one of the types specified by pType is present in hstrType in the DRAGITEM structure, TRUE 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.
PMERR_INSUFFICIENT_MEMORY (0x203E)
The operation terminated through insufficient memory.

Example Code

This example verifies whether a given type is present in the list of types defined for a drag object.

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

BOOL     fValid;
DRAGITEM Dragitem; /* DRAGITEM structure whose hstrType is */
                   /* to be verified                       */
char     pszType[] = "DRT_EXE";
                    /* A string specifying the types to    */
                    /* search for                           */

fValid = DrgVerifyType(&Dragitem, pszType);

Related Functions