Jump to content

DrgQueryNativeRMFLen

From EDM2
Revision as of 00:28, 8 April 2025 by Iturbide (talk | contribs) (Created page with "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 n...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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);
}

Related Functions