Increments an object's count of its strong external connections (links).
HRESULT AddConnection(
DWORD exconn, //Type of external connection
DWORD dwreserved //Used by OLE to pass connection information
);
An object created by a EXE object server relies on its stub manager to call IExternalConnection::AddConnection whenever a link client activates and therefore creates an external lock on the object. When the link client breaks the connection, the stub manager calls IExternalConnection::ReleaseConnection to release the lock.
Since DLL object applications exist in the same process space as their objects, they do not use RPC (remote procedure calls) and therefore do not have stub managers to keep track of external connections. Therefore, DLL servers that support external links to their objects must implement IExternalConnection so link clients can directly call the interface to inform them when connections are added or released.
The following is a typical implementation for the AddConnection method:
DWORD XX::AddConnection(DWORD extconn, DWORD dwReserved)
{
return extconn&EXTCONN_STRONG ? ++m_cStrong : 0;
}
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in objidl.h.
IExternalConnection::ReleaseConnection, IRunnableObject::LockRunning, OleLockRunning