home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / context.h < prev    next >
C/C++ Source or Header  |  1997-10-25  |  2KB  |  59 lines

  1. /*++
  2.  
  3.     Copyright    (c)    1997    Microsoft Corporation
  4.  
  5.     Module  Name :
  6.  
  7.         context.h
  8.  
  9.     Abstract:
  10.         A class to retrieve and release ASP intrinsics.  This class encapsulates the new way
  11.         of getting access to ASP instinsic objects.  It does away with the need for OnStartPage
  12.         and OnEndPage methods, and, by doing so, gives Application scope objects access to the
  13.         intrinsics.  The intrincis should never be retained across calls, as the context may
  14.         change between calls.
  15.  
  16.     Author:
  17.  
  18.         Neil Allain         August-1997 
  19.  
  20.     Revision History:
  21.  
  22. --*/
  23. #pragma once
  24. #ifndef _CONTEXT_H_
  25. #define _CONTEXT_H_
  26.  
  27. class CContext
  28. {
  29. public:
  30.     enum {
  31.         get_Server        = 0x0001,
  32.         get_Response    = 0x0002,
  33.         get_Request        = 0x0004,
  34.         get_Session        = 0x0008,
  35.         get_Application    = 0x0010,
  36.         get_All         = 0xFFFF
  37.     };
  38.     
  39.     HRESULT                Init( DWORD );
  40.  
  41.     IRequest*            Request(){ _ASSERT(m_piRequest!=NULL); return m_piRequest; }
  42.     IResponse*            Response(){ _ASSERT(m_piResponse!=NULL); return m_piResponse; }
  43.     ISessionObject*        Session(){ _ASSERT(m_piSession!=NULL); return m_piSession; }
  44.     IServer*            Server(){ _ASSERT(m_piServer!=NULL); return m_piServer; }
  45.     IApplicationObject*    Application(){ _ASSERT(m_piApplication!=NULL); return m_piApplication; }
  46.  
  47.     static HRESULT        GetServerObject( IGetContextProperties*, BSTR, const IID&, void** );
  48.  
  49. private:
  50.     CComPtr<IRequest>            m_piRequest;            //Request Object
  51.     CComPtr<IResponse>            m_piResponse;            //Response Object
  52.     CComPtr<ISessionObject>        m_piSession;            //Session Object
  53.     CComPtr<IServer>            m_piServer;                //Server Object
  54.     CComPtr<IApplicationObject> m_piApplication;        //Application Object
  55. };
  56.  
  57.  
  58. #endif    // !_CONTEXT_H_
  59.