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.

103 lines
3.0 KiB

  1. //+-------------------------------------------------------------------
  2. //
  3. // File: embed.hxx
  4. //
  5. // Contents: CTestEmbedCF and CTestEmbed object declarations
  6. //
  7. // History: 24-Nov-92 DeanE Created
  8. //
  9. //---------------------------------------------------------------------
  10. #ifndef __EMBED_HXX__
  11. #define __EMBED_HXX__
  12. extern "C" const GUID CLSID_TestEmbed;
  13. class CTestServerApp;
  14. class CTestEmbedCF;
  15. class CDataObject;
  16. class COleObject;
  17. class CPersistStorage;
  18. //+-------------------------------------------------------------------
  19. // Class: CTestEmbedCF
  20. //
  21. // Synopsis: Class Factory for CTestEmbed object type
  22. //
  23. // Methods: QueryInterface - IUnknown
  24. // AddRef - IUnknown
  25. // Release - IUnknown
  26. // CreateInstance - IClassFactory
  27. // LockServer - IClassFactory
  28. //
  29. // History: 24-Nov-92 DeanE Created
  30. //--------------------------------------------------------------------
  31. class CTestEmbedCF : public IClassFactory
  32. {
  33. public:
  34. // Constructor/Destructor
  35. CTestEmbedCF(CTestServerApp *ptsaServer);
  36. ~CTestEmbedCF();
  37. static IClassFactory FAR *Create(CTestServerApp *ptsaServer);
  38. // IUnknown
  39. STDMETHODIMP QueryInterface (REFIID iid, void FAR * FAR *ppv);
  40. STDMETHODIMP_(ULONG) AddRef (void);
  41. STDMETHODIMP_(ULONG) Release (void);
  42. // IClassFactory
  43. STDMETHODIMP CreateInstance (IUnknown FAR *pUnkOuter,
  44. REFIID iidInterface,
  45. void FAR * FAR *ppv);
  46. STDMETHODIMP LockServer (BOOL fLock);
  47. private:
  48. ULONG _cRef; // Reference count on this object
  49. CTestServerApp *_ptsaServer; // Controlling server app
  50. };
  51. //+-------------------------------------------------------------------
  52. // Class: CTestEmbed
  53. //
  54. // Synopsis: CTestEmbed (one instance per object)
  55. //
  56. // Methods: QueryInterface IUnknown
  57. // AddRef IUnknown
  58. // Release IUnknown
  59. // InitObject
  60. //
  61. // History: 24-Nov-92 DeanE Created
  62. //--------------------------------------------------------------------
  63. class CTestEmbed : public IUnknown
  64. {
  65. public:
  66. // Constructor/Destructor
  67. CTestEmbed();
  68. ~CTestEmbed();
  69. // IUnknown
  70. STDMETHODIMP QueryInterface(REFIID iid, void FAR * FAR *ppv);
  71. STDMETHODIMP_(ULONG) AddRef (void);
  72. STDMETHODIMP_(ULONG) Release (void);
  73. SCODE InitObject (CTestServerApp *ptsaServer, HWND hwnd);
  74. SCODE GetWindow (HWND *phwnd);
  75. private:
  76. ULONG _cRef; // Reference counter
  77. CTestServerApp *_ptsaServer; // Server "holding" this object
  78. CDataObject *_pDataObject; // Points to object's IDataObject
  79. COleObject *_pOleObject; // Points to object's IOleObject
  80. CPersistStorage *_pPersStg; // Points to object's IPersistStorage
  81. HWND _hwnd; // Window handle for this object
  82. };
  83. #endif // __EMBED_HXX__