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.7 KiB

  1. // DataObj.h : Declaration of the data object classes
  2. #ifndef __DATAOBJ_H_INCLUDED__
  3. #define __DATAOBJ_H_INCLUDED__
  4. #include "cookie.h" // CMyComputerCookie
  5. #include "stddtobj.h" // class DataObject
  6. class CMyComputerDataObject : public CDataObject
  7. {
  8. DECLARE_NOT_AGGREGATABLE(CMyComputerDataObject)
  9. public:
  10. // debug refcount
  11. #if DBG==1
  12. ULONG InternalAddRef()
  13. {
  14. return CComObjectRoot::InternalAddRef();
  15. }
  16. ULONG InternalRelease()
  17. {
  18. return CComObjectRoot::InternalRelease();
  19. }
  20. int dbg_InstID;
  21. #endif // DBG==1
  22. CMyComputerDataObject()
  23. : m_pcookie( NULL )
  24. , m_objecttype( MYCOMPUT_COMPUTER )
  25. , m_dataobjecttype( CCT_UNINITIALIZED )
  26. {
  27. }
  28. ~CMyComputerDataObject();
  29. virtual HRESULT Initialize( CMyComputerCookie* pcookie, DATA_OBJECT_TYPES type, BOOL fAllowOverrideMachineName );
  30. // IDataObject interface implementation
  31. HRESULT STDMETHODCALLTYPE GetDataHere(
  32. FORMATETC __RPC_FAR *pFormatEtcIn,
  33. STGMEDIUM __RPC_FAR *pMedium);
  34. //#define __DAN_MORIN_HARDCODED_CONTEXT_MENU_EXTENSION__
  35. HRESULT STDMETHODCALLTYPE GetData(
  36. FORMATETC __RPC_FAR *pFormatEtcIn,
  37. STGMEDIUM __RPC_FAR *pMedium);
  38. HRESULT PutDisplayName(STGMEDIUM* pMedium);
  39. HRESULT PutServiceName(STGMEDIUM* pMedium);
  40. protected:
  41. CMyComputerCookie* m_pcookie; // the CCookieBlock is AddRef'ed for the life of the DataObject
  42. MyComputerObjectType m_objecttype;
  43. DATA_OBJECT_TYPES m_dataobjecttype;
  44. BOOL m_fAllowOverrideMachineName; // From CMyComputerComponentData
  45. public:
  46. // Clipboard formats
  47. static CLIPFORMAT m_CFDisplayName;
  48. static CLIPFORMAT m_CFMachineName;
  49. // static CLIPFORMAT m_cfSendConsoleMessageText;
  50. static CLIPFORMAT m_cfSendConsoleMessageRecipients;
  51. }; // CMyComputerDataObject
  52. #endif // ~__DATAOBJ_H_INCLUDED__