DrgQueryNativeRMFLen
Appearance
Obtains the length of the string representing the native rendering mechanism and format of the dragged object.
Syntax
DrgQueryNativeRMFLen(pditem)
Parameters
- pditem (PDRAGITEM) - input
- Pointer to the DRAGITEM structure whose native rendering mechanism and format string length are to be obtained.
Returns
- ulLength (ULONG) - returns
- String length of the ordered pair.
- 0 - Error occurred.
- Other - String length of the ordered pair, excluding the null-terminating byte.
Remarks
This function is used to determine the size of the buffer that contains the string representing the native rendering mechanism and format of the dragged object. If the input string handle is NULLHANDLE or not valid, a length of 0 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
#define INCL_WINSTDDRAG /* Direct Manipulation (Drag) Functions */ #define INCL_DOSMEMMGR /* Memory Management Functions for */ /* DosSubAlloc */ #include <OS2.H> DRAGITEM ditem; PVOID pMem; PSZ pszBuffer; ULONG cb; BOOL rc, fResult; cb = DrgQueryNativeRMFLen(&ditem) + 1; rc = DosSubAlloc(pMem, (PVOID *) pszBuffer, cb); if (!rc) { fResult = DrgQueryNativeRMF(&ditem, cb, pszBuffer); }