例
以下の例は、GetName メソッドを使用してどのように接続名を戻すかを示します。
//-------------------------------------------------------------------
// 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