Leaked source code of windows server 2003
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.

63 lines
1.9 KiB

  1. //---------------------------------------------------------------------------
  2. // CMSR2C.h : CVDCursorFromRowset header file
  3. //
  4. // Copyright (c) 1996 Microsoft Corporation, All Rights Reserved
  5. // Developed by Sheridan Software Systems, Inc.
  6. //---------------------------------------------------------------------------
  7. #ifndef _CMSR2C_H_
  8. #define _CMSR2C_H_
  9. class CVDCursorFromRowset : public ICursorFromRowset,
  10. public ICursorFromRowPosition
  11. {
  12. public:
  13. static HRESULT CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID * ppvObj);
  14. protected:
  15. // construction/destruction
  16. CVDCursorFromRowset(LPUNKNOWN pUnkOuter);
  17. ~CVDCursorFromRowset();
  18. // data members
  19. LPUNKNOWN m_pUnkOuter; // pointer to controlling unknown
  20. public:
  21. // IUnknown methods
  22. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR *ppvObj);
  23. STDMETHOD_(ULONG,AddRef)(THIS);
  24. STDMETHOD_(ULONG,Release)(THIS);
  25. // ICursorFromRowset method
  26. STDMETHOD(GetCursor)(THIS_ IRowset *pRowset, ICursor **ppCursor, LCID lcid);
  27. // ICursorFromRowPosition method
  28. STDMETHOD(GetCursor)(THIS_ IRowPosition *pRowPosition, ICursor **ppCursor, LCID lcid);
  29. private:
  30. // the inner, private unknown implementation is for the aggregator
  31. // to control the lifetime of this object
  32. //
  33. class CPrivateUnknownObject : public IUnknown {
  34. public:
  35. STDMETHOD(QueryInterface)(REFIID riid, void **ppvObjOut);
  36. STDMETHOD_(ULONG, AddRef)(void);
  37. STDMETHOD_(ULONG, Release)(void);
  38. // constructor is remarkably trivial
  39. //
  40. CPrivateUnknownObject() : m_cRef(0) {}
  41. private:
  42. CVDCursorFromRowset *m_pMainUnknown();
  43. ULONG m_cRef;
  44. } m_UnkPrivate;
  45. friend class CPrivateUnknownObject;
  46. };
  47. typedef CVDCursorFromRowset* PCVDCursorFromRowset;
  48. #endif //_CMSR2C_H_
  49. /////////////////////////////////////////////////////////////////////////////