Programming Reference: ODDSConnection

# Programming Reference

## ODDSConnection

Class Definition File | ODDSConn.idl
Class C++ Binding | ODDSConn.xh

Class Hierarchy

    SOMObject
       ODObject
          ODDSConnection

Description

The ODDSConnection class is inherited by the SOM object that is to support events. Each OpenDoc part that supports events would inherit ODDSConnection. ODDSConnection responsibilities include:

- Maintain a list of event managers that the SOM object supports. Provide methods to add, delete, and obtain event managers as well as an enumerator to iterate through the list.
- Provide a method to add a sink to the sink list of a specific event manager and return its reference.
- Delete an event manager from the list.

Methods

The methods defined by the ODDSConnection class include:

- AddEventMgr
- AddSink
- CreateEventMgrEnum
- DeleteEventMgr
- GetEventMgr
- InitOLEConnectionPointContainer

Overridden Methods | There are no methods overridden by the ODDSConnection class.

### AddEventMgr

This method adds an event manager to the event manager list.

Signature

    long AddEventMgr (ODDSEventMgr *manager)

Parameters

manager (ODDSEventMgr *) - input

  The event manager to be added to the event manager list.

Returns

- ODDS_ERROR_INVALID_PARAMETER
- ODDS_ERROR_EVENTMGR_DUPLICATE

Remarks

This method adds an event manager to the event manager list. Once a manager is added to the event manager list, the event interface is available to all environments.

ODDSConnection owns the event manager and deletes it in its destructor.

Exception Handling

- ODDS_ERROR_OUTOFMEMORY

Related Methods

- ODDSEventMgr::DeleteEventMgr

### AddSink

This method adds an sink to the event manager list.

Signature

    long AddSink (ODDSSink *sink,
                  ODDSEventMgr **manager)

Parameters

sink (ODDSSink *) - input

  A reference to a sink.

manager (ODDSEventMgr **) - output

  A reference to the referenced event manager.

Returns

- ODDS_ERROR_INVALID_PARAMETER
- ODDS_ERROR_SINK_DUPLICATE
- ODDS_ERROR_ODGUID_NOT_SUPPORTED

Remarks

This method finds the event manager with the same unique ID as the sink and calls event manager's AddSink method to add that sink to the event manager sink list. This method returns the event manager for the later sink deletion. This method returns manager=NULL if not found. The same operation can be done by issuing an AddSink directly to the event manager.

Exception Handling

- ODDS_ERROR_OUTOFMEMORY

Related Methods

- ODDSEventMgr::AddSink
- ODDSEventMgr::RemoveSink

### CreateEventMgrEnum

This method creates and returns an enumeration object for iteration through the event managers.

Signature

    long CreateEventMgrEnum (ODDSEventMgrEnum **eventMgr)

Parameters

eventMgr (ODDSEventMgrEnum **) - output

  A reference to a reference to an event manager enumeration reference.

Returns

- ODDS_ERROR_INVALID_PARAMETER
- ODDS_ERROR_NOEVENTMGRS

Remarks

This method creates and returns an enumeration object for iteration through the event managers.

Exception Handling

- ODDS_ERROR_OUTOFMEMORY

### DeleteEventMgr

This method removes an event manager for the event manager list.

Signature

    long DeleteEventMgr (ODGUID *id)

Parameters

id (ODGUID *) - input

  A reference to the unique ID of the event manager.

Returns

- ODDS_ERROR_INVALID_PARAMETER
- ODDS_ERROR_EVENTMGR_NOTFOUND

Remarks

This method removes and event manager from the event manager list.

The sink list of the event manager is deleted as a result of the event manager destruction.

Related Methods

- ODDSConnection::AddEventMgr
- ODDSConnection::GetEventMgr

### GetEventMgr

This method returns the event manager with the give unique identifier.

Signature

    long GetEventMgr (ODGUID *id,
                      ODDSEventMgr **eventMgr)

Parameters

id (ODGUID *) - input

  A reference to the unique ID of the event manager.

eventMgr (ODDSEventMgr **) - output

  A reference to a reference to an event manager in which a reference to an event manager is returned.

Returns

- ODDS_ERROR_INVALID_PARAMETER
- ODDS_ERROR_EVENTMGR_NOTFOUND

Remarks

This method searches the event manager list and returns the event manager with the given unique identifier. It returns eventMgr=NULL if not found.

### InitOLEConnectionPointContainer

This method adds OLE connection point support a connection object.

Signature

    long InitOLEConnectionPointContainer (void *olewrapper,
                                          void *pUnkOuter,
                                          void **pmyUnk)

Parameters

olewrapper (void *) - input

  A reference to the object that wraps this object.

pUnkOuter (void *) - input

  A reference to the IUnknown interface that this object must delegate.

pmyUnk (void **) - output

  A reference to a void reference to this object IConnectionPointContainer interface is return.

Returns

- ODDS_ERROR_INVALID_PARAMETER

Remarks

This interface is used by OpenDoc OLE wrapper to establish the OLE IConnectionPoint container and IConnectionPoint interface for the OpenDoc part.

Exception Handling

- ODDS_ERROR_OUTOFMEMORY
- ODDS_ERROR_OLECONNECTION

[ Top | Previous | Next | Contents | Index | Documentation Homepage ]