Jump to content

WinQueryAtomLength: Difference between revisions

From EDM2
No edit summary
No edit summary
 
Line 3: Line 3:
==Syntax==
==Syntax==
  WinQueryAtomLength(hatomtblAtomTbl, atom)
  WinQueryAtomLength(hatomtblAtomTbl, atom)
==Parameters==
==Parameters==
;hatomtblAtomTbl (HATOMTBL) - input
;hatomtblAtomTbl (HATOMTBL) - input

Latest revision as of 04:08, 6 April 2025

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