Microsoft Internet Security and Acceleration Server 2000

Retrieving Each Server in the Array

The following code retrieves and stores each server and adapter. This code is taken from the file AdapterList.cpp, included in the serversconfigsample directory.

  1. Create the tree that stores the server and adapter information, shown here:
    	/* Make the root of the tree */
    	HTREEITEM RootItem = m_ListTree.InsertItem( _T("All Servers"), 0, 0);
    	HTREEITEM ServItem;
    	/* Make headlines */
    	m_ListCtl.InsertColumn( 0, _T("Server Name") );
    	m_ListCtl.InsertColumn( 1, _T("Adapter Description") );
    	m_ListCtl.SetColumnWidth( 0, LVSCW_AUTOSIZE_USEHEADER );
    	m_ListCtl.SetColumnWidth( 1, LVSCW_AUTOSIZE_USEHEADER);
  2. Find each server in the array, shown here:
    	/* Go along the hierarchy to find the all the servers */
    	/* and their adapters								 */
    	FPCLib::IFPCSnapinNodePtr spiFPCSnapinNode(m_pDataObject);
    	FPCLib::IFPCServersPtr spiServers(spiFPCSnapinNode->CurrentObject);