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.

208 lines
5.5 KiB

  1. //+-------------------------------------------------------------------
  2. //
  3. // File: bscbnd.hxx
  4. //
  5. // Contents: This file contins the DLL entry points
  6. // LibMain
  7. // DllGetClassObject (Bindings key func)
  8. // DllCanUnloadNow
  9. // CBasicBndCF (class factory)
  10. // History: 30-Mar-92 SarahJ Created
  11. //
  12. //---------------------------------------------------------------------
  13. #ifndef __BSCBND_H__
  14. #define __BSCBND_H__
  15. extern "C" const GUID CLSID_BasicBnd;
  16. extern "C" const GUID CLSID_TestEmbed;
  17. #define STGM_DFRALL (STGM_READWRITE | STGM_TRANSACTED | STGM_SHARE_DENY_WRITE)
  18. //
  19. // Define the interface we are going to use here - avoiding MIDL stuff
  20. //
  21. //+-------------------------------------------------------------------
  22. //
  23. // Class: CBasicBndCF
  24. //
  25. // Synopsis: Class Factory for CBasicBnd
  26. //
  27. // Methods: IUnknown - QueryInterface, AddRef, Release
  28. // IClassFactory - CreateInstance
  29. //
  30. // History: 21-Mar-92 SarahJ Created
  31. //
  32. //--------------------------------------------------------------------
  33. class FAR CBasicBndCF: public IClassFactory
  34. {
  35. public:
  36. // Constructor/Destructor
  37. CBasicBndCF();
  38. ~CBasicBndCF();
  39. // IUnknown
  40. STDMETHODIMP QueryInterface(REFIID iid, void FAR * FAR * ppv);
  41. STDMETHODIMP_(ULONG) AddRef(void);
  42. STDMETHODIMP_(ULONG) Release(void);
  43. // IClassFactory
  44. STDMETHODIMP CreateInstance(IUnknown FAR* pUnkOuter,
  45. REFIID iidInterface,
  46. void FAR* FAR* ppv);
  47. STDMETHODIMP LockServer(BOOL fLock);
  48. BOOL ReleaseClass(void);
  49. private:
  50. ULONG _cRefs;
  51. };
  52. //+-------------------------------------------------------------------
  53. //
  54. // Class: CBasicBnd
  55. //
  56. // Synopsis: Test class CBasicBnd
  57. //
  58. // Methods:
  59. //
  60. // History: 21-Mar-92 SarahJ Created
  61. //
  62. //--------------------------------------------------------------------
  63. class FAR CBasicBnd: public IPersistFile, public IOleClientSite,
  64. public IOleObject, public IOleItemContainer
  65. {
  66. public:
  67. // *** Constructor/Destructor
  68. CBasicBnd(IUnknown *punk);
  69. ~CBasicBnd();
  70. // *** IUnknown
  71. STDMETHODIMP QueryInterface(REFIID iid, void FAR * FAR * ppv);
  72. STDMETHODIMP_(ULONG) AddRef(void);
  73. STDMETHODIMP_(ULONG) Release(void);
  74. // *** IPersist
  75. STDMETHODIMP GetClassID(LPCLSID lpClassID);
  76. // *** IPersitFile
  77. STDMETHODIMP IsDirty();
  78. STDMETHODIMP Load(LPCOLESTR lpszFileName, DWORD grfMode);
  79. STDMETHODIMP Save(LPCOLESTR lpszFileName, BOOL fRemember);
  80. STDMETHODIMP SaveCompleted(LPCOLESTR lpszFileName);
  81. STDMETHODIMP GetCurFile(LPOLESTR FAR * lplpszFileName);
  82. // *** IOleObject methods ***
  83. STDMETHODIMP SetClientSite( LPOLECLIENTSITE pClientSite);
  84. STDMETHODIMP GetClientSite( LPOLECLIENTSITE FAR* ppClientSite);
  85. STDMETHODIMP SetHostNames( LPCOLESTR szContainerApp, LPCOLESTR szContainerObj);
  86. STDMETHODIMP Close(DWORD dwSaveOption);
  87. STDMETHODIMP SetMoniker( DWORD dwWhichMoniker, LPMONIKER pmk);
  88. STDMETHODIMP GetMoniker( DWORD dwAssign, DWORD dwWhichMoniker,
  89. LPMONIKER FAR* ppmk);
  90. STDMETHODIMP InitFromData( LPDATAOBJECT pDataObject,
  91. BOOL fCreation,
  92. DWORD dwReserved);
  93. STDMETHODIMP GetClipboardData( DWORD dwReserved,
  94. LPDATAOBJECT FAR* ppDataObject);
  95. STDMETHODIMP DoVerb( LONG iVerb,
  96. LPMSG lpmsg,
  97. LPOLECLIENTSITE pActiveSite,
  98. LONG lindex,
  99. HWND hwndParent,
  100. LPCRECT lprcPosRect);
  101. STDMETHODIMP EnumVerbs(LPENUMOLEVERB FAR* ppenumOleVerb);
  102. STDMETHODIMP Update(void);
  103. STDMETHODIMP IsUpToDate(void);
  104. STDMETHODIMP GetUserClassID(CLSID FAR *pClsid);
  105. STDMETHODIMP GetUserType(DWORD dwFormOfType, LPOLESTR FAR* pszUserType);
  106. STDMETHODIMP SetExtent( DWORD dwDrawAspect, LPSIZEL lpsizel);
  107. STDMETHODIMP GetExtent( DWORD dwDrawAspect, LPSIZEL lpsizel);
  108. STDMETHODIMP Advise( LPADVISESINK pAdvSink, DWORD FAR* pdwConnection);
  109. STDMETHODIMP Unadvise( DWORD dwConnection);
  110. STDMETHODIMP EnumAdvise( LPENUMSTATDATA FAR* ppenumAdvise);
  111. STDMETHODIMP GetMiscStatus(DWORD dwAspect, DWORD FAR* pdwStatus);
  112. STDMETHODIMP SetColorScheme( LPLOGPALETTE lpLogpal);
  113. // *** IParseDisplayName method ***
  114. STDMETHODIMP ParseDisplayName(
  115. LPBC pbc,
  116. LPOLESTR lpszDisplayName,
  117. ULONG FAR* pchEaten,
  118. LPMONIKER FAR* ppmkOut) ;
  119. // *** IOleContainer methods ***
  120. STDMETHODIMP EnumObjects(DWORD grfFlags, LPENUMUNKNOWN FAR* ppenumUnknown);
  121. STDMETHODIMP LockContainer(BOOL fLock);
  122. // *** IOleItemContainer methods ***
  123. STDMETHODIMP GetObject(
  124. LPOLESTR lpszItem,
  125. DWORD dwSpeedNeeded,
  126. LPBINDCTX pbc,
  127. REFIID riid,
  128. LPVOID FAR* ppvObject);
  129. STDMETHODIMP GetObjectStorage(
  130. LPOLESTR lpszItem,
  131. LPBINDCTX pbc,
  132. REFIID riid,
  133. LPVOID FAR* ppvStorage);
  134. STDMETHODIMP IsRunning(LPOLESTR lpszItem) ;
  135. // *** IOleClientSite
  136. STDMETHODIMP SaveObject (void);
  137. STDMETHODIMP GetContainer (LPOLECONTAINER FAR *ppContainer);
  138. STDMETHODIMP ShowObject (void);
  139. STDMETHODIMP OnShowWindow (BOOL fShow);
  140. STDMETHODIMP RequestNewObjectLayout (void);
  141. private:
  142. IUnknown * _punk;
  143. IMoniker * _pmkContainer;
  144. IStorage * _psStg1;
  145. IStorage * _psStg2;
  146. };
  147. class CUnknownBasicBnd : public IUnknown
  148. {
  149. public:
  150. CUnknownBasicBnd(IUnknown *punk);
  151. ~CUnknownBasicBnd(void);
  152. // *** IUnknown
  153. STDMETHODIMP QueryInterface(REFIID iid, void FAR * FAR * ppv);
  154. STDMETHODIMP_(ULONG) AddRef(void);
  155. STDMETHODIMP_(ULONG) Release(void);
  156. private:
  157. CBasicBnd * _pbasicbnd;
  158. ULONG _cRefs;
  159. };
  160. #endif // __BSCBND_H__