Jump to content

WinQueryAtomLength

From EDM2
Revision as of 22:19, 10 December 2023 by Martini (talk | contribs) (Created page with "This function queries the length of an atom represented by the specified atom. ==Syntax== WinQueryAtomLength(hatomtblAtomTbl, atom) ==Parameters== ;hatomtblAtomTbl (HATOM...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function queries the length of an atom represented by the specified atom.

Syntax

WinQueryAtomLength(hatomtblAtomTbl, atom)

Parameters

hatomtblAtomTbl (HATOMTBL) - input
Atom-table handle.
The handle returned from a previous WinCreateAtomTable or WinQuerySystemAtomTable function.
atom (ATOM) - input
Atom whose associated character-string length is to be returned.

Returns

ulretlen (ULONG) - returns
Return code.
String length.
The specified atom or the atom table is invalid.
Other
The length of the character string associated with the atom excluding the null terminating byte. Integer atoms always return a length of six.

Errors

Possible returns from WinGetLastError

PMERR_INVALID_HATOMTBL (0x1013)
An invalid atom-table handle was specified.
PMERR_INVALID_ATOM (0x1014)
The specified atom does not exist in the atom table.

Remarks

The purpose of this function is to allow an application to determine the size of buffer to use in the WinQueryAtomName call.

Example Code

This function queries the length of an atom.

#define INCL_WINATOM
#include <OS2.H>

HATOMTBL atomtbl;
ATOM atom = 25;

      WinQueryAtomlength(atomtbl,  /* atom handle. */ atom);

Definition

#define INCL_WINATOM /* Or use INCL_WIN, INCL_PM, */
#include <os2.h>

HATOMTBL    hatomtblAtomTbl;  /*  Atom-table handle. */
ATOM        atom;             /*  Atom whose associated character-string length is to be returned. */
ULONG       ulretlen;         /*  String length. */

ulretlen = WinQueryAtomLength(hatomtblAtomTbl, atom);

Related Functions