Kbase 17140: How to Call WIN32 API Function: DeleteAtom
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
How to Call WIN32 API Function: DeleteAtom
DISCLAIMER:
===========
The code example in this knowledgebase is for informational purposes
only. If you have specific questions about which API calls would be
best suited to your design goals, please consult your Microsoft
documentation.
INTRODUCTION:
=============
The following sample code shows how to call the Win32 API function
DeleteAtom. This function decrements the reference count of a local
atom, deleting the atom from the local atom table once the reference
count equals zero. Unlike the global atom table, the local atom
table is deleted when the program is exited, along with all stored
atoms, so it is not necessary to call DeleteAtom() for each entry in
the atom table.
This code has been tested on Windows NT 4.0 Workstation only.
DEFINE VARIABLE intAtom AS INTEGER NO-UNDO.
DEFINE VARIABLE intResult AS INTEGER NO-UNDO.
PROCEDURE DeleteAtom EXTERNAL "KERNEL32.DLL":
DEFINE INPUT PARAMETER intAtom AS SHORT.
DEFINE RETURN PARAMETER intResult AS SHORT.
END PROCEDURE.
RUN DeleteAtom (INPUT intAtom, OUTPUT intResult).
IF intResult = 0 THEN
MESSAGE "Atom Reference Count Decremented" VIEW-AS ALERT-BOX.
ELSE
MESSAGE "Function call failed, not sure why" VIEW-AS ALERT-BOX.
Progress Software Technical Support Note # 17140