LVectorBase::EnumGroups
#include "lvkrn.h"
virtual L_INT LVectorBase::EnumGroups()
Enumerates all groups inside the class object's associated vector handle.
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
The LVectorBase::EnumGroups function calls the LVectorBase::EnumGroupsCallback function as it gets a pointer to each vector group.
To use the LVectorBase::EnumGroupsCallBack function, you must derive a class from LVectorBase and override the LVectorBase::EnumGroupsCallBack member function.
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: |
|
Topics: |
Example
//Example136
// This example enumerates through all groups in a vector
class LMyVectorBase5: public LVectorBase
{
public:
L_INT m_nGroupCount ;
public:
LMyVectorBase5() {m_nGroupCount=0;};
virtual ~LMyVectorBase5(){};
virtual L_INT EnumGroupsCallBack(pVECTORHANDLE pVector, pVECTORGROUP pGroup);
};
L_INT LMyVectorBase5::EnumGroupsCallBack(pVECTORHANDLE pVector, pVECTORGROUP pGroup)
{
LVectorGroup VectorGroup(pGroup, this);
L_TCHAR szMsg[100];
m_nGroupCount++;
VECTORGROUPDESC GroupDesc;
VectorGroup.GetGroupDesc(&GroupDesc);
wsprintf(szMsg, TEXT("Group\nName[%s]\nSize[%d]"),
GroupDesc.szName,
GroupDesc.nSize
);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
return SUCCESS ;
//...LVectorGroup destructor called when VectorGroup goes out of scope
}
L_VOID Example136(HWND hWnd, LMyVectorBase5 *pMyVector)
{
LMyVectorBase5 MyVector;
L_TCHAR szMsg[100];
pMyVector->m_nGroupCount=0;
pMyVector->EnableCallBack(TRUE);
pMyVector->EnumGroups();
wsprintf(szMsg, TEXT("Total Groups[%d]"), pMyVector->m_nGroupCount);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
}