L_VecGetGroupCount

#include "ltvkrn.h"

L_LTVKRN_API L_INT L_VecGetGroupCount(pVector)

Returns the number of groups inside a vector handle.

Parameters

const pVECTORHANDLE pVector

Pointer to the vector handle.

Returns

Number of groups.

Comments

After calling this function, L_VecGetGroupByIndex can be used to iterate through the groups in a vector handle.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example will show the names of the all groups inside a vector handle, in a message box.

L_LTVKRNTEX_API L_INT VecGetGroupCountExample(pVECTORHANDLE pVector) 
{ 
   L_INT nRet; 
   L_INT nCount, i; 
   VECTORGROUP Group; 
   VECTORGROUPDESC GroupDesc; 
 
   /* Get number of groups inside the vector handle */ 
   nCount = L_VecGetGroupCount( pVector ); 
 
   nRet = SUCCESS; 
 
   /* Iterate through the groups */ 
   for( i = 0; i < nCount; i++ ) 
   { 
      /* Get group and its descriptor */ 
      nRet = L_VecGetGroupByIndex( pVector, i, &Group ); 
      if(nRet != SUCCESS) 
         return nRet; 
 
      nRet = L_VecGetGroup( pVector, &Group, &GroupDesc ); 
      if(nRet != SUCCESS) 
         return nRet; 
 
      /* Show name in a message box */ 
      MessageBox( NULL, GroupDesc.szName, TEXT("Group Name"), MB_OK ); 
 
      /* Free the group descriptor because it's no longer needed */ 
      nRet = L_VecFreeGroup( &GroupDesc ); 
   } 
 
   return nRet; 
} 

Help Version 21.0.2021.4.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Vector C API Help