Ver Mensaje Individual
  #12  
Antiguo 10-11-2006
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Buena pregunta, al parecer en C++ es distinto, no hay operador is.

Aquí ya no tengo el C++ para probar pero intentemos a ciegas:

Código:
TShape * __fastcall TForm1::FindShape(TPoint Pos)
{
  integer i;

  for (i = 0; i < this->ComponentCount; i++)
  {
    if (dynamic_cast<TShape *>(this->Components[i]))
    {
      if PtInRect(((TShape *)this->Components[i])->BoundsRect, Pos)
      {
         return ((TShape *)this->Components[i]);
      }
    }
  }

  return NULL;
}
// Saludos
Responder Con Cita