LPDISPATCH getDBLayerWithIndex(int dbLayerIndex)
This method retrieves the LayerAPI object of the layer, from among those layers associated with a database table, with zero-based index dbLayerIndex. The argument dbLayerIndex must be between 0 and n, where n is the value returned by getNumDBLayers.
A database layer's index is determined by its relative position in the Spatial Agent File (SAF), with non-database layers eliminated from the counting procedure.
The method is used as shown below.
n VC++, allocated on the heap (assuming mapAPI is a pointer to a MapAPI):
ILayerAPI* layrAPI = new ILayerAPI;
layrAPI->m_lpDispatch = mapAPI->getDBLayerWithIndex(2);
In VC++, on the stack (assuming mapAPI is a pointer to a MapAPI):
layr.m_lpDispatch = mapAPI->getDBLayerWithIndex(2);
In VB (assuming mapAPI is a MapAPI object):
In the declarations:
Public layrAPI As Object
Private layrAPI As Object
Set layrAPI = mapAPI.getDBLayerWithIndex(2)
The client receives an instance of this object shared by other clients, if any.