GetFeatureList
Top  Previous  Next

Description

Returns the array of strings containing the names of camera features and categories grouped under the specified category.


Syntax


[VB]
Value=objActiveGeni.GetFeatureList( Category )


[C/C++]
HRESULT GetFeatureList( bstr Category, VARIANT* pList );


Data Types
[VB]

Category: String
Return value
: Variant (SAFEARRAY)


Parameters
[C/C++]

Category [in]  
Name of the category or sub-category for the list of features. If this parameter is "Root", the list of upper-level categories and features will be returned.  
 
pList [out,retval]  
Pointer to the SAFEARRAY of strings containing the list of features under the specified category. An empty array indicates that the name of a feature is used instead of the name of a category.  


Return Values


S_OK  
Success  
E_NOINTERFACE  
Category is not supported by the camera  
E_FAIL  
Failure.  


Example


This VB example initializes a combo box with the names of the camera features grouped ander the "AnalogControls" category:

Private Sub
 Form_Load()
FeatureLst = ActiveGeni1.GetFeatureList("AnalogControls")
For
 i = 0 
To
 
UBound
(FeatureLst)
Combo1.AddItem (FeatureLst(i))
Next

Combo1.ListIndex = 0
ActiveGeni1.Acquire = 
True
End Sub

Private Sub
 Combo1_Click()
ActiveGeni1.Feature = Combo1.ListIndex
End Sub

This MFC example fills out a combo box with camera features grouped under the "TriggerAcquisition" category:

VARIANT m_FeatureArray=m_ActiveGeni.GetFeatureList("TriggerAcquisition");
SAFEARRAY *pArray=m_FeatureArray.parray;
UINT nFeatures=pArray->rgsabound[0].cElements;

CString strFeature;
CComboBox *pFeature=(CComboBox*)GetDlgItem(IDC_FEATURE);
for(UINT i=0;i<nFeatures;i++)
{
   pFeature->AddString(strFeature);
}
int iFeature=m_ActiveGeni.GetFeature();
pFeature->SetCurSel(iFeature);


SafeArrayDestroy(pArray);


 

Remarks


To get or set the value of a specific camera feature, use GetFeature, GetFeatureString, SetFeature, SetFeatureString

Note that in C/C++ applications it is required to call SafeArrayDestroy() to delete the SAFEARRAY returned by GetFeatureList.