GetInterfaceAtIndex
Top  Previous  Next

Description

Returns the IP address of the network interface at the specified index in the system interface list.


Syntax


[C++]
int
 GetInterfaceAtIndex(unsigned int index, static char* pIP)


Parameters
[C/C++]
 
[in] unsigned int index  
Index of the requested interface in the system interface list.  
 
[out] const char* pIP  
Pointer to a 16-byte buffer that receives the string value of the IP address in the IPv4 format (four decimals in the range of 0-255 separated by dots).  
 

Return Values


S_OK  
Success  
E_FAIL  
Failure  
E_NOINTERFACE  
Index outside of range  
 

Example


This fragment of an MFC code fills out a combo box with IP addresses of network interfaces installed on the system.

for (int i = 0; i < m_pCamera->GetInterfaceCount(); i++)  
{  
   char buf[20];  
   m_pCamera->GetInterfaceAtIndex(i, buf);  
   m_interfaceList.AddString(buf);  
}  
m_interfaceList.SetCurSel(0);  


Remarks


This method is typically used in combination with GetInterfaceCount to list all network interfaces installed on the system. A virtual camera can then be bound to one of the interfaces by calling Connect.

The list of system interfaces contains all network interfaces including Wi-Fi and some virtual interfaces that are not compatible with the GigE Vision standard. They may be utilized for connecting to a client application on the local host, but only GigE interfaces should be used for remote connections.