COleDispatchDriver::DetachDispatch

Detaches the current IDispatch connection from this object.

LPDISPATCH DetachDispatch( );

Return Value

A pointer to the previously attached OLE IDispatch object.

Remarks

The IDispatch is not released.

For more information about the LPDISPATCH type, see Implementing the IDispatch Interface [Automation] in the Windows SDK.

Example

LPDISPATCH CreateLPDispatch(LPCTSTR lpszProgId)
{
    COleDispatchDriver disp;

    disp.CreateDispatch(lpszProgId);

    return disp.DetachDispatch();
}

Requirements

Header: afxdisp.h

See Also

Reference

COleDispatchDriver Class

Hierarchy Chart

COleDispatchDriver::ReleaseDispatch

COleDispatchDriver::CreateDispatch

COleDispatchDriver::AttachDispatch

COleDispatchDriver::m_lpDispatch