home *** CD-ROM | disk | FTP | other *** search
- /*----------------------------------------------------------------------
- Using this file to build other OLE interfaces.....
- 0. Follow the directions in EX.H first.
- 1. Replace the include file "EX.H" with the name of the proper include
- file.
- 2. Place the interface functions at the end of the file.
- 3. Update IUnknown.cpp to include your new class.
- 4. Add your new file to the BuildMak file, rebuild and compile.
- ----------------------------------------------------------------------*/
-
- #include "Ole2Inc.h"
- // Replace this include with yours.
- #include "Ex.h"
-
- CI* :: CI* ( LPUNKNOWN pUnkOuter , PCIUnknown pMainIUnk )
- {
- m_cRef = 0 ;
- m_pUnkOuter = pUnkOuter ;
- m_pBaseUnk = pMainIUnk ;
- }
-
- CI* :: ~CI* ( void )
- {
- }
-
- BOOL CI* :: Init ( void )
- {
- return ( TRUE ) ;
- }
-
- STDMETHODIMP_( ULONG ) CI* :: AddRef ( void )
- {
- m_cRef++ ;
- return ( m_cRef ) ;
- }
-
- STDMETHODIMP_( ULONG ) CI* :: Release ( void )
- {
- m_cRef-- ;
- if ( 0L != m_cRef )
- {
- return ( m_cRef ) ;
- }
-
- delete this ;
- return ( 0 ) ;
- }
-
- STDMETHODIMP CI* :: QueryInterface ( REFIID riid ,
- PPVOID ppv )
- {
- *ppv = NULL ;
-
- // Replace IID_I* with the proper IID.
- if ( IID_I* == riid )
- {
- *ppv = (I**)this ;
- ((LPUNKNOWN)*ppv)->AddRef ( ) ;
- return ( NOERROR ) ;
- }
- else
- {
- // We just defer any other calls to the base IUnknown.
- return ( m_pBaseUnk->QueryInterface ( riid , ppv ) ) ;
- }
- }
-
- STDMETHODIMP CI* :: InternalQueryInterface ( REFIID riid ,
- PPVOID ppv )
- {
- // Always set the interface memory location to NULL.
- *ppv = NULL ;
-
- // If this ID is ours, then return ourselves.
- if ( IID_I* == riid )
- {
- *ppv = (I**)this ;
- return ( NOERROR ) ;
- }
- return ( E_NOINTERFACE ) ;
- }
-
-
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // Place all interface functions here!!
-
-