LAnnAudioClip::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::GetUserHandles(pAnnHandle, pCount)

pANNHANDLE pAnnHandle;

/* array of ANNHANDLE structures that define user handles */

L_UINT *pCount;

/* pointer to an unsigned integer used to return the total count of user handles */

Gets information about all existing user-defined annotation handles.

Parameter

Description

pAnnHandle

Array of ANNHANDLE structures to be updated with the user-defined handles.

pCount

Pointer to an unsigned integer used to return the total number of user handles

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Call with pAnnHandle == NULL to get the total number of user handles. Then allocate memory for an array of ANNHANDLE structures and call this function again.

Gets an array of user-defined handles associated with the annotation object.

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

Win32, x64.

See Also

Functions:

Class Members

Topics:

Annotation Functions: Object Properties

 

Implementing Annotations

 

Automated User Interface for Annotations

 

Annotation Functions: Creating and Deleting Annotations

 

Types of Annotations

 

Annotation Functions: Implementing Custom Annotations

 

Annotation Functions: Creating Custom Annotations

 

Fixed Annotations

 

Minimizing Flicker With Double Buffering

 

Annotation Functions: Working with the Toolbar

Example

// This example displays information about all the user handles in an object

L_VOID DumpAnnHandles(L_UINT      uIndex,
                     pANNHANDLE  pAnnHandle)
{
   L_TCHAR szMsg[400];
   if (pAnnHandle)
   {
      _stprintf_s(szMsg, TEXT("uIndex %d\nnSize: %d\nnID: %d\n aptContainer[%f,%f]\nptClient[%d,%d]\nbVisible: %s\ncrPen: 0x%x\ncrFill: 0x%x\nnShape: %s\nhCursor: %s\n"),
         uIndex,
         pAnnHandle->uStructSize,  
         pAnnHandle->nID,
         pAnnHandle->aptContainer.x, pAnnHandle->aptContainer.y, 
         pAnnHandle->ptClient.x,     pAnnHandle->ptClient.y,
         pAnnHandle->bVisible ? TEXT("Visible") : TEXT("Not Visible"),
         pAnnHandle->crPen,
         pAnnHandle->crFill,
         pAnnHandle->nShape == ANNHANDLE_SHAPE_SQUARE ? TEXT("Square") : TEXT("Circle"),
         pAnnHandle->hCursor ? TEXT("Cursor") : TEXT("No Cursor")
         );
      MessageBox(NULL, szMsg, TEXT(""), MB_OK);
   }
}
L_INT LAnnAudioClip_GetUserHandlesExample(HANNOBJECT& hObject)
{
   L_INT nRet;
   L_UINT i;
   L_UINT uCount;
   pANNHANDLE  pAnnHandle;
   LAnnAudioClip MyAnnAudioClip(hObject);
   // Get the total count of user handles, and allocate memory
   nRet = MyAnnAudioClip.GetUserHandles(NULL, &uCount);
   if(nRet != SUCCESS)
      return nRet;
   pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));
   if(pAnnHandle == NULL)
      return ERROR_NO_MEMORY;
   nRet = MyAnnAudioClip.GetUserHandles(pAnnHandle, &uCount);
   if(nRet != SUCCESS)
      return nRet;
   for (i = 0; i < uCount; i++)
      DumpAnnHandles(i, pAnnHandle + i);
   free(pAnnHandle);
   return SUCCESS;
}