home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / vcoledb / provider / myprov / myprovidersess.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  1.8 KB  |  58 lines

  1. // Session.h : Declaration of the CMyProviderSession
  2. //
  3. // This is a part of the Active Template Library.
  4. // Copyright (C) 1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // ActiveX Template Library Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // ActiveX Template Library product.
  12.  
  13. #ifndef __CMyProviderSession_H_
  14. #define __CMyProviderSession_H_
  15. #include "resource.h"       // main symbols
  16. #include "MyProviderRS.h"
  17.  
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CMyProviderSession
  20. class ATL_NO_VTABLE CMyProviderSession :
  21.     public CComObjectRootEx<CComMultiThreadModel>,
  22.     public IGetDataSourceImpl<CMyProviderSession>,
  23.     public IOpenRowsetImpl<CMyProviderSession>,
  24.     public ISessionPropertiesImpl<CMyProviderSession>,
  25.     public IObjectWithSiteSessionImpl<CMyProviderSession>,
  26.     public IDBCreateCommandImpl<CMyProviderSession, CMyProviderCommand>
  27. {
  28. public:
  29.     CMyProviderSession()
  30.     {
  31.     }
  32.     HRESULT FinalConstruct()
  33.     {
  34.         return FInit();
  35.     }
  36.     STDMETHOD(OpenRowset)(IUnknown *pUnkOuter, DBID *pTableID, DBID *pIndexID, REFIID riid,
  37.                        ULONG cPropertySets, DBPROPSET rgPropertySets[], IUnknown **ppRowset)
  38.     {
  39.         CAgentRowset* pAgentRS;
  40.         return CreateRowset(pUnkOuter, pTableID, pIndexID, riid, cPropertySets, rgPropertySets, ppRowset, pAgentRS);
  41.  
  42.     }
  43.  
  44. BEGIN_PROPSET_MAP(CMyProviderSession)
  45.     CHAIN_PROPERTY_SET(CMyProviderCommand)
  46. END_PROPSET_MAP()
  47.  
  48. BEGIN_COM_MAP(CMyProviderSession)
  49.     COM_INTERFACE_ENTRY(IGetDataSource)
  50.     COM_INTERFACE_ENTRY(IOpenRowset)
  51.     COM_INTERFACE_ENTRY(ISessionProperties)
  52.     COM_INTERFACE_ENTRY(IObjectWithSite)
  53.     COM_INTERFACE_ENTRY(IDBCreateCommand)
  54. END_COM_MAP()
  55. public:
  56. };
  57. #endif //__CMyProviderSession_H_
  58.