WinQueryAtomLength: Difference between revisions
Appearance
Created page with "This function queries the length of an atom represented by the specified atom. ==Syntax== WinQueryAtomLength(hatomtblAtomTbl, atom) ==Parameters== ;hatomtblAtomTbl (HATOM..." |
No edit summary |
||
Line 9: | Line 9: | ||
:The handle returned from a previous WinCreateAtomTable or WinQuerySystemAtomTable function. | :The handle returned from a previous WinCreateAtomTable or WinQuerySystemAtomTable function. | ||
;atom (ATOM) - input | ;atom ([[ATOM]]) - input | ||
:Atom whose associated character-string length is to be returned. | :Atom whose associated character-string length is to be returned. | ||
==Returns== | ==Returns== | ||
;ulretlen (ULONG) - returns | ;ulretlen ([[ULONG]]) - returns | ||
:Return code. | :Return code. | ||
:;String length. | :;String length. |
Revision as of 04:01, 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);