Example

The following example shows how to create an ECLPageSettings object using the connection name and the connection handle.

void Sample108() {
   
   ECLPageSettings *PgSet1, *PgSet2; // Pointer to ECLPageSettings objects
   ECLConnList ConnList; // Connection list object

   try {
      // Create ECLPageSettings object for connection 'A'
      PgSet1 = new ECLPageSettings('A');
      // Create ECLPageSettings object for first connection in conn list
      ECLConnection *Connection = ConnList.GetFirstConnection();
      if (Connection != NULL) {
         PgSet2 = new ECLPageSettings(Connection->GetHandle()); 
         printf("PgSet#1 is for connection %c, PgSet #2 is for connection %c.\n",
                 PgSet1->GetName(), PgSet2->GetName());
         delete PgSet1;
         delete PgSet2;
      }
      else 
         printf("No connections to create PageSettings object.\n");
   } catch (ECLErr Err) {
      printf("ECL Error: %s\n", Err.GetMsgText());
   }
} // end sample