Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.8 KiB

  1. // txnobj.h : Declaration of the CASPObjectContext
  2. #ifndef __TXNOBJ_H_
  3. #define __TXNOBJ_H_
  4. #include "resource.h" // main symbols
  5. #include <mtx.h>
  6. /////////////////////////////////////////////////////////////////////////////
  7. // CASPObjectContext
  8. //
  9. class ATL_NO_VTABLE CASPObjectContext
  10. : public IObjectControl
  11. , public IASPObjectContextCustom
  12. , public ISupportErrorInfo
  13. , public CComObjectRootEx<CComMultiThreadModel>
  14. , public CComCoClass<CASPObjectContext, &CLSID_ASPObjectContextTxRequired>
  15. , public IDispatchImpl<IASPObjectContext, &IID_IASPObjectContext, &LIBID_ASPTxnTypeLibrary, 2, 0>
  16. {
  17. public:
  18. CASPObjectContext()
  19. : m_fAborted(FALSE)
  20. {
  21. }
  22. DECLARE_REGISTRY_RESOURCEID(IDR_ASPOBJECTCONTEXT)
  23. BEGIN_COM_MAP(CASPObjectContext)
  24. COM_INTERFACE_ENTRY(IASPObjectContextCustom)
  25. COM_INTERFACE_ENTRY(IASPObjectContext)
  26. COM_INTERFACE_ENTRY(IObjectControl)
  27. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  28. COM_INTERFACE_ENTRY(IDispatch)
  29. END_COM_MAP()
  30. // IObjectControl
  31. public:
  32. STDMETHOD(Activate)();
  33. STDMETHOD_(BOOL, CanBePooled)();
  34. STDMETHOD_(void, Deactivate)();
  35. // ISupportsErrorInfo
  36. public:
  37. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  38. private:
  39. CComPtr<IObjectContext> m_spObjectContext;
  40. BOOL m_fAborted;
  41. // IASPObjectContext & IASPObjectContextCustom
  42. public:
  43. STDMETHOD(SetAbort)();
  44. STDMETHOD(SetComplete)();
  45. #ifdef _WIN64
  46. // Win64 fix -- use UINT64 instead of LONG_PTR since LONG_PTR is broken for Win64 1/21/2000
  47. STDMETHOD(Call)(UINT64 pvScriptEngine, LPCOLESTR strEntryPoint, boolean *pfAborted);
  48. STDMETHOD(ResetScript)(UINT64 pvScriptEngine);
  49. #else
  50. STDMETHOD(Call)(LONG_PTR pvScriptEngine, LPCOLESTR strEntryPoint, boolean *pfAborted);
  51. STDMETHOD(ResetScript)(LONG_PTR pvScriptEngine);
  52. #endif
  53. };
  54. #endif //__TXNOBJ_H_