Apple Network Setup Manual do Utilizador Página 47

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 184
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 46
CHAPTER 2
Using Network Setup
Working with Sets 47
*activeEntity = (**entitiesInSet).fElements[entityIndex].fEntityRef;
OTCfgChangeEntityArea(activeEntity, area);
}
if (entitiesInSet != nil) {
DisposeHandle( (Handle) entitiesInSet ); assert(MemError() ==
noErr);
}
return err;
}
The code in Listing 2-15 pulls together the process of finding an active set entity
by finding the active TCP/IP set entity. It opens the database, calls
MyFindFirstActiveEntity (Listing 2-14) with kOTCfgClassNetworkConnection and
kOTCfgTypeTCPv4 as parameters, calls MyGetEntityUserVisibleName (Listing 2-9)
to get and print the entity’s user visible name, and calls
MyCloseDatabaseAfterReading (Listing 2-3) to close the database.
Listing 2-15 Finding the active TCP/IP entity
static void PrintActiveTCPEntity(void)
{
OSStatus err;
CfgDatabaseRef dbRef;
CfgAreaID readArea;
CfgEntityRef activeTCPEntity;
Str255 userVisibleName;
err = MyOpenDatabaseForReading(&dbRef, &readArea);
if (err == noErr) {
err = MyFindFirstActiveEntity(dbRef, readArea,
kOTCfgClassNetworkConnection,
kOTCfgTypeTCPv4,
&activeTCPEntity);
if (err == noErr) {
err = MyGetEntityUserVisibleName(dbRef, &activeTCPEntity, userVisibleName);
}
if (err == noErr) {
Vista de página 46
1 2 ... 42 43 44 45 46 47 48 49 50 51 52 ... 183 184

Comentários a estes Manuais

Sem comentários