GetCameraList
Top  Previous  Next

Description

Returns the array of strings containing the names of DCAM cameras connected to the 1394 board.


Syntax


[VB]
Value=objActiveDcam.GetCameraList()


[C/C++]
HRESULT GetCameraList( VARIANT* pList );


Data Types
[VB]

Return value: Variant (SAFEARRAY)


Parameters
[C/C++]

pList [out,retval]  
Pointer to the SAFEARRAY containing camera names  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  


Example


This VB example initializes a combo box with camera names and uses it to switch between the cameras:

Private Sub
 Form_Load()
CamLst = ActiveDcam1.GetCameraList
For
 i = 0 
To
 UBound(CamLst)
Combo1.AddItem (CamLst(i))
Next
Combo1.ListIndex = 0
ActiveDcam1.Acquire = 
True
End Sub

Private Sub
 Combo1_Click()
ActiveDcam1.Camera = Combo1.ListIndex
End Sub
 
This MFC example fills out a combo box with camera names:

VARIANT m_CamArray=m_ActiveDcam.GetCameraList();
SAFEARRAY *pArray=m_CamArray.parray;
UINT nCam=pArray->rgsabound[0].cElements;

CString strCamera;
CComboBox *pCamera=(CComboBox*)GetDlgItem(IDC_CAMERA);
for(UINT i=0;i<nCam;i++)
{
      CString str; str.Format("Camera %d",i);
      pCamera->AddString(str);
}
int iCam=m_ActiveDcam.GetCamera();
pCamera->SetCurSel(iCam);


SafeArrayDestroy(pArray);



Remarks


The index of an element in the camera list can be used as an argument of the Camera property to select a specific camera.

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