L_AnnGetItem

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetItem(hContainer, phItem)

HANNOBJECT hContainer;

/* handle of the container object */

pHANNOBJECT phItem;

/* address of the variable to be updated */

Gets the handle to the first annotation object in the specified container. This function is available in the Document/Medical Toolkits.

Parameter

Description

hContainer

Handle of the container object.

phItem

Address of the HANNOBJECT variable to be updated with the object’s handle. If the container does not have any objects, the updated value is NULL.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

You can use this function to see if a container is empty.

Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phItem parameter. This function will update the variable with the handle of the first object in the container.

Required DLLs and Libraries

LTANN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AnnGetContainer, L_AnnInsert, L_AnnRemove, L_AnnGetTopContainer, L_AnnEnumerate

Topics:

Annotation Functions: Creating and Deleting Annotations

 

Annotation Functions: Object Information

 

Implementing Annotations

 

Implementing an Automated Annotation Program

 

Implementing a Non-automated Annotation Program

 

Obtaining Annotation Object Information

Example

/* This example deletes the object that is passed in, if it is an empty subcontainer. */
void TestAnnGetItem(HANNOBJECT hThisObject)
{
   L_UINT ObjectType; /* Type of annotation object */
   HANNOBJECT hTestObject;
   HANNOBJECT hRootContainer; /* Root container for the whole window */
   /* Get the root container */
   L_AnnGetTopContainer(hThisObject, &hRootContainer);
   /* Do nothing if this is the root container */
   if (hThisObject == hRootContainer)
      return;
   /* See if this is a container */
   L_AnnGetType(hThisObject, &ObjectType);
   /* Do nothing if it is not a container */
   if (ObjectType != ANNOBJECT_CONTAINER)
      return;
   /* See if there are any objects in the container */
   L_AnnGetItem(hThisObject, &hTestObject);
   /* If there are none, delete the container */
   if (hTestObject == NULL)
   {
      L_AnnDestroy(hThisObject, 0);
      MessageBox (NULL, TEXT("Deleted empty container"), TEXT("Notice"), MB_OK);
   }
   return;
}