L_VecGetLayerCount

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetLayerCount(pVector)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

Returns the number of layers inside a vector handle.

Parameter

Description

pVector

Pointer to the vector handle.

Returns

Number of layers.

Comments

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

Required DLLs and Libraries

LVKRN

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

See Also

Functions:

L_VecGetLayerByName, L_VecGetLayerByIndex, L_VecGetLayer.

Topics:

Working with Vector Layers

Example

/* This example will show the names of the all layers inside a vector handle, in a message box */
L_VOID ShowLayers( pVECTORHANDLE pVector )
{
   L_INT             nCount, i;
   VECTORLAYER       Layer;
   VECTORLAYERDESC   LayerDesc;

   /* Get number of layers inside the vector handle */
   nCount = L_VecGetLayerCount( pVector );

   /* Iterate through the layers */
   for( i = 0; i < nCount; i++ )
   {
      /* Get layer and its descriptor */
      L_VecGetLayerByIndex( pVector, i, &Layer );
      L_VecGetLayer( pVector, &Layer, &LayerDesc );

      /* Show name in a message box */
      MessageBox( NULL, LayerDesc.szName, TEXT("Layer Name"), MB_OK );

      /* Free the layer descriptor because it's no longer needed */
      L_VecFreeLayer( &LayerDesc );
   }
}