Example

The following example shows how to use the GetName method to return the connection name.

//-------------------------------------------------------------------
// ECLConnection::GetName
//
// Find the first 3270 display connection in the current list of
// all connections and display its name (session ID).
//-------------------------------------------------------------------
void Sample11() {
 
ULONG      i;             // Connection counter
ECLConnList ConnList;     // Connection list object
ECLConnection *Info=NULL; // Pointer to connection object
 
for (i=0; i<ConnList.GetCount(); i++) {
 
  Info = ConnList.GetNextConnection(Info);
  if (Info->GetConnType() == HOSTTYPE_3270DISPLAY) {
    // Found the first 3270 display connection, display the name
    printf("First 3270 display connection is '%c'.\n",
            Info->GetName());
    return;
  }
 
} // for
printf("Found no 3270 display connections.\n");
 
} // end sample