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.

318 lines
7.4 KiB

  1. //**********************************************************************
  2. // File name: HLP_IAS.cxx
  3. //
  4. // Implementation file of CAdviseSink
  5. //
  6. //
  7. // Functions:
  8. //
  9. // See IAS.H for Class Definition
  10. //
  11. // Copyright (c) 1992 - 1993 Microsoft Corporation. All rights reserved.
  12. //**********************************************************************
  13. #include <headers.cxx>
  14. #pragma hdrstop
  15. #include "hlp_iocs.hxx"
  16. #include "hlp_ias.hxx"
  17. #include "hlp_app.hxx"
  18. #include "hlp_site.hxx"
  19. #include "hlp_doc.hxx"
  20. //**********************************************************************
  21. //
  22. // CAdviseSink::QueryInterface
  23. //
  24. // Purpose:
  25. //
  26. // Returns a pointer to a requested interface.
  27. //
  28. // Parameters:
  29. //
  30. // REFIID riid - The requested interface
  31. //
  32. // LPVOID FAR* ppvObj - Place to return the interface
  33. //
  34. // Return Value:
  35. //
  36. // HRESULT from CSimpleSite::QueryInterface
  37. //
  38. // Function Calls:
  39. // Function Location
  40. //
  41. // CSimpleSite::QueryInterface SITE.cxx
  42. // OutputDebugString Windows API
  43. //
  44. // Comments:
  45. //
  46. // This function simply delegates to the Object class, which is
  47. // aware of the supported interfaces.
  48. //
  49. //********************************************************************
  50. STDMETHODIMP CAdviseSink::QueryInterface(REFIID riid, LPVOID FAR* ppvObj)
  51. {
  52. DEBUGOUT(L"In IAS::QueryInterface\r\n");
  53. // delegate to the document Object
  54. return m_pSite->QueryInterface(riid, ppvObj);
  55. }
  56. //**********************************************************************
  57. //
  58. // CAdviseSink::AddRef
  59. //
  60. // Purpose:
  61. //
  62. // Increments the reference count on this interface
  63. //
  64. // Parameters:
  65. //
  66. // None
  67. //
  68. // Return Value:
  69. //
  70. // The current reference count on this interface.
  71. //
  72. // Function Calls:
  73. // Function Location
  74. //
  75. // CSimpleSite::AddReff SITE.cxx
  76. // OutputDebugString Windows API
  77. //
  78. // Comments:
  79. //
  80. // This function adds one to the ref count of the interface,
  81. // and calls then calls CSimpleSite to increment its ref.
  82. // count.
  83. //
  84. //********************************************************************
  85. STDMETHODIMP_(ULONG) CAdviseSink::AddRef()
  86. {
  87. DEBUGOUT(L"In IAS::AddRef\r\n");
  88. // increment the interface reference count (for debugging only)
  89. ++m_nCount;
  90. // delegate to the container Site
  91. return m_pSite->AddRef();
  92. }
  93. //**********************************************************************
  94. //
  95. // CAdviseSink::Release
  96. //
  97. // Purpose:
  98. //
  99. // Decrements the reference count on this interface
  100. //
  101. // Parameters:
  102. //
  103. // None
  104. //
  105. // Return Value:
  106. //
  107. // The current reference count on this interface.
  108. //
  109. // Function Calls:
  110. // Function Location
  111. //
  112. // CSimpleSite::Release SITE.cxx
  113. // OutputDebugString Windows API
  114. //
  115. // Comments:
  116. //
  117. // This function subtracts one from the ref count of the interface,
  118. // and calls then calls CSimpleSite to decrement its ref.
  119. // count.
  120. //
  121. //********************************************************************
  122. STDMETHODIMP_(ULONG) CAdviseSink::Release()
  123. {
  124. DEBUGOUT(L"In IAS::Release\r\n");
  125. // decrement the interface reference count (for debugging only)
  126. m_nCount--;
  127. // delegate to the container Site
  128. return m_pSite->Release();
  129. }
  130. //**********************************************************************
  131. //
  132. // CAdviseSink::OnDataChange
  133. //
  134. // Purpose:
  135. //
  136. // Not Implemented (needs to be stubbed out)
  137. //
  138. // Parameters:
  139. //
  140. // Not Implemented (needs to be stubbed out)
  141. //
  142. // Return Value:
  143. //
  144. // Not Implemented (needs to be stubbed out)
  145. //
  146. // Function Calls:
  147. // Function Location
  148. //
  149. // OutputDebugString Windows API
  150. //
  151. // Comments:
  152. //
  153. // Not Implemented (needs to be stubbed out)
  154. //
  155. //********************************************************************
  156. STDMETHODIMP_(void) CAdviseSink::OnDataChange (FORMATETC FAR* pFormatetc, STGMEDIUM FAR* pStgmed)
  157. {
  158. DEBUGOUT(L"In IAS::OnDataChange\r\n");
  159. }
  160. //**********************************************************************
  161. //
  162. // CAdviseSink::OnViewChange
  163. //
  164. // Purpose:
  165. //
  166. // Notifies us that the view has changed and needs to be updated.
  167. //
  168. // Parameters:
  169. //
  170. // DWORD dwAspect - Aspect that has changed
  171. //
  172. // LONG lindex - Index that has changed
  173. //
  174. // Return Value:
  175. //
  176. // None
  177. //
  178. // Function Calls:
  179. // Function Location
  180. //
  181. // OutputDebugString Windows API
  182. // InvalidateRect Windows API
  183. // IViewObject2::GetExtent Object
  184. //
  185. // Comments:
  186. //
  187. //********************************************************************
  188. STDMETHODIMP_(void) CAdviseSink::OnViewChange (DWORD dwAspect, LONG lindex)
  189. {
  190. LPVIEWOBJECT2 lpViewObject2;
  191. DEBUGOUT(L"In IAS::OnViewChange\r\n");
  192. // get a pointer to IViewObject2
  193. HRESULT hErr = m_pSite->m_lpOleObject->QueryInterface(
  194. IID_IViewObject2,(LPVOID FAR *)&lpViewObject2);
  195. if (hErr == NOERROR) {
  196. // get extent of the object
  197. // NOTE: this method will never be remoted; it can be called w/i this async method
  198. lpViewObject2->GetExtent(DVASPECT_CONTENT, -1 , NULL, &m_pSite->m_sizel);
  199. lpViewObject2->Release();
  200. }
  201. InvalidateRect(m_pSite->m_lpDoc->m_hDocWnd, NULL, TRUE);
  202. }
  203. //**********************************************************************
  204. //
  205. // CAdviseSink::OnRename
  206. //
  207. // Purpose:
  208. //
  209. // Not Implemented (needs to be stubbed out)
  210. //
  211. // Parameters:
  212. //
  213. // Not Implemented (needs to be stubbed out)
  214. //
  215. // Return Value:
  216. //
  217. // Not Implemented (needs to be stubbed out)
  218. //
  219. // Function Calls:
  220. // Function Location
  221. //
  222. // OutputDebugString Windows API
  223. //
  224. // Comments:
  225. //
  226. // Not Implemented (needs to be stubbed out)
  227. //
  228. //********************************************************************
  229. STDMETHODIMP_(void) CAdviseSink::OnRename (LPMONIKER pmk)
  230. {
  231. DEBUGOUT(L"In IAS::OnRename\r\n");
  232. }
  233. //**********************************************************************
  234. //
  235. // CAdviseSink::OnSave
  236. //
  237. // Purpose:
  238. //
  239. // Not Implemented (needs to be stubbed out)
  240. //
  241. // Parameters:
  242. //
  243. // Not Implemented (needs to be stubbed out)
  244. //
  245. // Return Value:
  246. //
  247. // Not Implemented (needs to be stubbed out)
  248. //
  249. // Function Calls:
  250. // Function Location
  251. //
  252. // OutputDebugString Windows API
  253. //
  254. // Comments:
  255. //
  256. // Not Implemented (needs to be stubbed out)
  257. //
  258. //********************************************************************
  259. STDMETHODIMP_(void) CAdviseSink::OnSave ()
  260. {
  261. DEBUGOUT(L"In IAS::OnSave\r\n");
  262. }
  263. //**********************************************************************
  264. //
  265. // CAdviseSink::OnClose
  266. //
  267. // Purpose:
  268. //
  269. // Not Implemented (needs to be stubbed out)
  270. //
  271. // Parameters:
  272. //
  273. // Not Implemented (needs to be stubbed out)
  274. //
  275. // Return Value:
  276. //
  277. // Not Implemented (needs to be stubbed out)
  278. //
  279. // Function Calls:
  280. // Function Location
  281. //
  282. // OutputDebugString Windows API
  283. //
  284. // Comments:
  285. //
  286. // Not Implemented (needs to be stubbed out)
  287. //
  288. //********************************************************************
  289. STDMETHODIMP_(void) CAdviseSink::OnClose()
  290. {
  291. DEBUGOUT(L"In IAS::OnClose\r\n");
  292. }