IEC.CPP
资源名称:MSDN_VC98.zip [点击查看]
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:5k
源码类别:
Windows编程
开发平台:
Visual C++
- //**********************************************************************
- // File name: IEC.CPP
- //
- // Implementation file for the CExternalConnection Class
- //
- // Functions:
- //
- // See iec.h for a list of member functions.
- //
- // Copyright (c) 1993-1997 Microsoft Corporation. All rights reserved.
- //**********************************************************************
- #include "pre.h"
- #include "obj.h"
- #include "iec.h"
- #include "app.h"
- #include "doc.h"
- //**********************************************************************
- //
- // CExternalConnection::QueryInterface
- //
- // Purpose:
- //
- //
- // Parameters:
- //
- // REFIID riid - Interface being queried for.
- //
- // LPVOID FAR *ppvObj - Out pointer for the interface.
- //
- // Return Value:
- //
- // S_OK - Success
- // E_NOINTERFACE - Failure
- //
- // Function Calls:
- // Function Location
- //
- // CSimpSvrObj::QueryInterface OBJ.CPP
- //
- // Comments:
- //
- //
- //********************************************************************
- STDMETHODIMP CExternalConnection::QueryInterface (REFIID riid, LPVOID FAR* ppvObj)
- {
- OutputDebugString("In CExternalConnection::QueryInterfacern");
- return m_lpObj->QueryInterface(riid, ppvObj);
- }
- //**********************************************************************
- //
- // CExternalConnection::AddRef
- //
- // Purpose:
- //
- // Increments the reference count on CExternalConnection and the "object"
- // object.
- //
- // Parameters:
- //
- // None
- //
- // Return Value:
- //
- // The Reference count on the Object.
- //
- // Function Calls:
- // Function Location
- //
- // OuputDebugString Windows API
- // CSimpSvrObj::AddRef OBJ.CPP
- //
- // Comments:
- //
- //
- //********************************************************************
- STDMETHODIMP_(ULONG) CExternalConnection::AddRef ()
- {
- OutputDebugString("In CExternalConnection::AddRefrn");
- ++m_nCount;
- return m_lpObj->AddRef();
- };
- //**********************************************************************
- //
- // CExternalConnection::Release
- //
- // Purpose:
- //
- // Decrements the reference count of COleObject and the
- // "object" object.
- //
- // Parameters:
- //
- // None
- //
- // Return Value:
- //
- // The new reference count
- //
- // Function Calls:
- // Function Location
- //
- // OutputDebugString Windows API
- // CSimpSvrObj::Release OBJ.CPP
- //
- // Comments:
- //
- //
- //********************************************************************
- STDMETHODIMP_(ULONG) CExternalConnection::Release ()
- {
- OutputDebugString("In CExternalConnection::Releasern");
- --m_nCount;
- return m_lpObj->Release();
- };
- //**********************************************************************
- //
- // CExternalConnection::AddConnection
- //
- // Purpose:
- //
- // Called when another connection is made to the object.
- //
- // Parameters:
- //
- // DWORD extconn - Type of connection
- //
- // DWORD reserved - Reserved
- //
- // Return Value:
- //
- // Strong connection count
- //
- // Function Calls:
- // Function Location
- //
- // OutputDebugString Windows API
- //
- // Comments:
- //
- //
- //********************************************************************
- STDMETHODIMP_(DWORD) CExternalConnection::AddConnection (DWORD extconn, DWORD reserved)
- {
- OutputDebugString("In CExternalConnection::AddConnectionrn");
- if (extconn & EXTCONN_STRONG)
- return ++m_dwStrong;
- return 0;
- }
- //**********************************************************************
- //
- // CExternalConnection::ReleaseConnection
- //
- // Purpose:
- //
- // Called when a connection to the object is released.
- //
- // Parameters:
- //
- // DWORD extconn - Type of Connection
- //
- // DWORD reserved - Reserved
- //
- // BOOL fLastReleaseCloses - Close flag
- //
- // Return Value:
- //
- // The new reference count
- //
- // Function Calls:
- // Function Location
- //
- // OutputDebugString Windows API
- // COleObject::Close IOO.CPP
- //
- // Comments:
- //
- //
- //********************************************************************
- STDMETHODIMP_(DWORD) CExternalConnection::ReleaseConnection (DWORD extconn, DWORD reserved, BOOL fLastReleaseCloses)
- {
- OutputDebugString("In CExternalConnection::ReleaseConnectionrn");
- if (extconn & EXTCONN_STRONG)
- {
- DWORD dwSave = --m_dwStrong;
- if (!m_dwStrong && fLastReleaseCloses)
- m_lpObj->m_OleObject.Close(OLECLOSE_SAVEIFDIRTY);
- return dwSave;
- }
- return 0;
- }