Enumerates all objects inside the vector group object.
#include "ltwrappr.h"
virtual L_INT LVectorGroup::EnumObjects (dwFlags)
Flag that indicates which objects to enumerate. Possible values are:
Value | Meaning |
---|---|
0 | Enumerate all objects in the group. |
VECTOR_FLAGS_SELECTED_ONLY | Enumerate only selected objects in the group. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This example displays the total number of objects in each group in a vector.
class LMyVectorGroup1: public LVectorGroup
{
public:
L_INT m_nObjectCount ;
public:
LMyVectorGroup1() {m_nObjectCount=0;};
virtual ~LMyVectorGroup1(){};
virtual L_INT EnumObjectsCallBack( pVECTORHANDLE pVector, pVECTOROBJECT pObject);
};
L_INT LMyVectorGroup1::EnumObjectsCallBack( pVECTORHANDLE pVector, pVECTOROBJECT pObject)
{
UNREFERENCED_PARAMETER(pVector);
UNREFERENCED_PARAMETER(pObject);
m_nObjectCount++;
return SUCCESS;
}
L_INT LVectorGroup__EnumObjectsExample(HWND hWnd, LVectorBase *pVector)
{
L_INT nRet;
L_INT i;
for (i=0; i<pVector->GetGroupCount(); i++)
{
LMyVectorGroup1 VectorGroup;
L_TCHAR szMsg[200];
nRet = pVector->GetGroupByIndex(i, &VectorGroup);
if(nRet != SUCCESS)
return nRet;
VectorGroup.m_nObjectCount = 0;
VectorGroup.EnableCallBack(TRUE);
VectorGroup.EnumObjects();
wsprintf(szMsg, TEXT("Group[%d]: Total Objects[%d]"), i, VectorGroup.m_nObjectCount);
MessageBox(hWnd, szMsg, TEXT(""), MB_OK);
}
return SUCCESS;
}