home *** CD-ROM | disk | FTP | other *** search
- /*
- * OleCntrl.cpp
- * $Header: /bcsample/IFACEDLL/OLECNTRL.CPP 1 5/28/96 1:12p Dave $
- *
- * Description:
- * This file provides the test-implementation of the IOleControl interface.
- *
- * Notes:
- * <implementation notes go here>
- *
- ***********************************************************************
- *
- * NuMega Technologies, Inc.
- * P.O. Box 7780
- * Nashua, NH 03060
- *
- * (c) Copyright 1994, 1995, 1996 NuMega Technologies, Inc.
- * ALL RIGHTS RESERVED.
- *
- ***********************************************************************
- *
- **********************************************************************/
-
-
- #include "IFT_OLE.h"
- #include "olecntrl.h"
-
- CIOleControl :: CIOleControl ( LPUNKNOWN pUnkOuter , PCIUnknown pMainIUnk )
- {
- m_cRef = 0 ;
- m_pUnkOuter = pUnkOuter ;
- m_pBaseUnk = pMainIUnk ;
- }
-
- CIOleControl :: ~CIOleControl ( void )
- {
- }
-
- BOOL CIOleControl :: Init ( void )
- {
- return ( TRUE ) ;
- }
-
- STDMETHODIMP_( ULONG ) CIOleControl :: AddRef ( void )
- {
- return ( m_pBaseUnk->AddRef( ) ) ;
- }
-
- STDMETHODIMP_( ULONG ) CIOleControl :: Release ( void )
- {
- return ( m_pBaseUnk->Release( ) ) ;
- }
-
- STDMETHODIMP CIOleControl :: QueryInterface ( REFIID riid ,
- PPVOID ppv )
- {
- *ppv = NULL ;
-
- if ( IID_IOleControl == riid )
- {
- *ppv = ( IOleControl* )this ;
- ( ( LPUNKNOWN ) *ppv )->AddRef ( ) ;
- return ( NOERROR ) ;
- }
- else
- {
- // We just defer any other calls to the base IUnknown.
- return ( m_pBaseUnk->QueryInterface ( riid , ppv ) ) ;
- }
- }
-
- STDMETHODIMP CIOleControl :: 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_IOleControl == riid )
- {
- *ppv = (IOleControl*)this ;
- return ( NOERROR ) ;
- }
- return ( E_NOINTERFACE ) ;
- }
-
-
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // Place all interface functions here!!
-
- HRESULT __stdcall CIOleControl :: GetControlInfo ( LPCONTROLINFO pCI )
- {
- return ( S_OK ) ;
- }
-
- HRESULT __stdcall CIOleControl :: OnMnemonic ( LPMSG pMsg )
- {
- return ( S_OK ) ;
- }
-
- HRESULT __stdcall CIOleControl :: OnAmbientPropertyChange ( DISPID dispid )
- {
- return ( S_OK ) ;
- }
-
- HRESULT __stdcall CIOleControl :: FreezeEvents ( BOOL bFreeze )
- {
- return ( S_OK ) ;
- }
-
-