### ICommandConnectionTo

  The ICommandConnectionTo class is a template class, derived from ICommandHandler, that processes application and system command events and routes them to the template argument class. This class allows you to process command events in objects that do not derive from ICommandHandler without having to manually derive from ICommandHandler, override the command and systemCommand functions, and pass the events to the object.

  The ICommandConnectionTo class routes both command and system command events to the same member of the template argument class. You can use the eventId member of ICommandEvent to distinguish between these two events.

  To use the ICommandConnectionTo class, follow these steps:

  1. Instantiate the ICommandConnectionTo template with a class containing a member function whose signature and behavior are the same as ICommandHandler::command.
  2. Construct an object of the new template class by passing the object and the address of the member function handling the command events.
  3. Attach the template command handler by using IHandler::handleEventsFor to pass the appropriate window to the command handler.

  You use an ICommandConnectionTo object anywhere you use an ICommandHandler object. See the class description of ICommandHandler for a description of the uses and limitations of these classes.

### ICommandConnectionTo - Member Functions and Data by Group

### Constructors & Destructor

You can construct and destruct template objects of this class. You cannot copy or assign objects of this class.

~ICommandConnectionTo

      public:
      virtual ~ICommandConnectionTo()

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

ICommandConnectionTo

      public:
      ICommandConnectionTo( ATarget& target,
                            MemberFunction memberFunction )

  Constructs the ICommandConnectionTo object.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Event Processing

These members are overridden to route command and system command events to the target object provided on construction.

command

      protected:
      virtual bool command(ICommandEvent& event)

  Overridden to route command events to the member function of the target object provided on construction.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

systemCommand

      protected:
      virtual bool systemCommand(ICommandEvent& event)

  Overridden to route system command events to the member function of the target object provided on construction.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### ICommandConnectionTo - Type Definitions

MemberFunction

      typedef bool (ATarget::*MemberFunction)(ICommandEvent&)

  A pointer to a member function of Class ATarget that takes a reference to an ICommandEvent and returns a boolean.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### ICommandConnectionTo - Inherited Member Functions and Data

#### Inherited Public Functions

  ICommandHandler

  -     virtual ~ICommandHandler()

  -     ICommandHandler()

  IHandler

  -     virtual ~IHandler()

  -     virtual IString asDebugInfo() const

  -     virtual IString asString() const

  -     virtual IHandler& disable()

  -     virtual IHandler& enable(bool enable = true)

  -     virtual IHandler& handleEventsFor(IWindow* window)

  -     IHandler()

  -     bool isEnabled() const

  -     virtual IHandler& stopHandlingEventsFor(IWindow* window)

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  IHandler

  -     virtual IEventResult defaultProcedure(IEvent& event)

  -     virtual bool dispatchHandlerEvent(IEvent& event) = 0

  ICommandHandler

  -     virtual bool dispatchHandlerEvent(IEvent& event)

#### Inherited Protected Data

  - None