共用方式為


COleDispatchDriver::DetachDispatch

LPDISPATCHDetachDispatch();

Return Value

A pointer to the previously attached OLE IDispatch object.

Remarks

Detaches the current IDispatch connection from this object. The IDispatch is not released.

For more information about the LPDISPATCH type, see in the OLE Programmer’s Reference.

Example

LPDISPATCH CreateLPDispatch(LPCTSTR lpszProgId)
{
    COleDispatchDriver disp;

    disp.CreateDispatch(lpszProgId);

    return disp.DetachDispatch();
}

COleDispatchDriver OverviewClass MembersHierarchy Chart

See Also   COleDispatchDriver::ReleaseDispatch, COleDispatchDriver::CreateDispatch, COleDispatchDriver::AttachDispatch, COleDispatchDriver::m_lpDispatch