Exemple #1
0
int
TAO_Object_Adapter::activate_poa (const poa_name &folded_name,
                                  TAO_Root_POA *&poa)
{
  int result = -1;

#if (TAO_HAS_MINIMUM_POA == 0) &&  !defined (CORBA_E_MICRO)

  iteratable_poa_name ipn (folded_name);
  iteratable_poa_name::iterator iterator = ipn.begin ();
  iteratable_poa_name::iterator end = ipn.end ();

  TAO_Root_POA *parent = this->root_;
  if (parent == 0 || parent->name () != *iterator)
    throw ::CORBA::OBJ_ADAPTER ();
  else
    ++iterator;

  for (;
       iterator != end;
       ++iterator)
    {
      TAO_Root_POA *current = 0;

      try
        {
          current = parent->find_POA_i (*iterator, 1);
        }
      catch (const PortableServer::POA::AdapterNonExistent&)
        {
          return -1;
        }

      parent = current;
    }

  poa = parent;
  result = 0;
#else
  ACE_UNUSED_ARG (folded_name);
  ACE_UNUSED_ARG (poa);
#endif /* TAO_HAS_MINIMUM_POA == 0 */

  return result;
}
int main(void)
{
      char n;
      int x=10,y=10;
      clrscr();
      textbackground(0);
      ipn();
      Sleep(600);
      voca3();
      Sleep(1000);
      marco();
      textcolor(10);
      Sleep(200);
      textbackground(0);
      gotoxy(10,11);
      printf("Altas");
      Sleep(200);
      gotoxy(10,12);
      textbackground(0);
      printf("Bajas");
      Sleep(200);
      gotoxy(10,13);
      textbackground(0);
      printf("Modificaciones");
      Sleep(200);
      textbackground(0);
      gotoxy(10,14);
      printf("Consultas");
      Sleep(200);
      gotoxy(10,15);
      textbackground(0);
      printf("Reportes");
      Sleep(200);
      gotoxy(10,16);
      textbackground(0);
      printf("Salir");
      Sleep(500);
      about();

      do
      {
             n = tolower(getch());
             switch(n)
             {
                      case 'w':
                           if(y<=16 && y>=12)
                           {
                                    y=y-1;
                                    menu(&x,&y);
                                    about();
                           }
                           else
                           {
                               Beep(9000,300);
                               if(y==12)
                               {
                                        y=9;
                                        menu(&x,&y);
                                        about();
                               }
                           }
                           break;

                      case 's':
                           if(y<=15 && y>=10)
                           {
                                    y=y+1;
                                    menu(&x,&y);
                                    about();
                           }
                           
                           else
                           {
                               y=16;
                               Beep(9000,300);
                               menu(&x,&y);
                               about();
                           }
                           break;

                      case enter:
                           if(y==11)
                           {
                                    daralta();
                           }
                           if(y==12)
                           {
                                    darbaja();
                           }
                           if(y==13)
                           {
                                    modificaciones();
                           }
                           if(y==14)
                           {
                                    consultas();
                           }
                           if(y==15)
                           {
                                    reportes();
                           }
                           if(y==16)
                           {
                                    salir();
                           }
                           break;
                      
             }  
      }
      while(n !='v');
}