DrgQueryNativeRMF
Appearance
Obtains the ordered pair that represents the native rendering mechanism and format of the dragged object.
Syntax
DrgQueryNativeRMF(pditem, cbBuffer, pBuffer)
Parameters
- pditem (PDRAGITEM) - input
- Pointer to the DRAGITEM structure whose native rendering mechanism and format are to be obtained.
- cbBuffer (ULONG) - input
- Maximum number of bytes to copy to the buffer.
- pBuffer (PCHAR) - output
- Pointer to the buffer in which the null-terminated string is to be returned.
Returns
- rc (BOOL) - returns
- Success indicator.
- TRUE - Successful completion.
- FALSE - Error occurred.
Remarks
If the rendering mechanism and format string for the object are NULL, FALSE is returned. If TRUE is returned, the format of the string is:
(mechanism(1)[,mechanism(n)...]),(format(1)[,format(n)...])
The native rendering mechanism and format are the first ordered pair, or the first ordered pair produced by a cross product, in the string associated with hstrRMF in the DRAGITEM structure. DrgQueryNativeRMFLen can be used to determine the size of the buffer required to hold the string returned by this function.
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); }