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.

314 lines
6.8 KiB

  1. //**********************************************************************
  2. // File name: IOCS.CPP
  3. //
  4. // Implementation file for COleClientSite
  5. //
  6. // Functions:
  7. //
  8. // See IOCS.H for class definition
  9. //
  10. // Copyright (c) 1992 - 1996 Microsoft Corporation. All rights reserved.
  11. //**********************************************************************
  12. #include "pre.h"
  13. //**********************************************************************
  14. //
  15. // COleClientSite::QueryInterface
  16. //
  17. // Purpose:
  18. //
  19. // Used for interface negotiation at this interface
  20. //
  21. // Parameters:
  22. //
  23. // REFIID riid - A reference to the interface that is
  24. // being queried.
  25. //
  26. // LPVOID FAR* ppvObj - An out parameter to return a pointer to
  27. // the interface.
  28. //
  29. // Return Value:
  30. //
  31. // S_OK - The interface is supported.
  32. // E_NOINTERFACE - The interface is not supported
  33. //
  34. // Function Calls:
  35. // Function Location
  36. //
  37. // COleClientSite::QueryInterface SITE.CPP
  38. //
  39. // Comments:
  40. //
  41. //********************************************************************
  42. STDMETHODIMP COleClientSite::QueryInterface(REFIID riid, LPVOID FAR* ppvObj)
  43. {
  44. TraceMsg(TF_GENERAL, "In IOCS::QueryInterface\r\n");
  45. // delegate to the container Site
  46. return m_pSite->QueryInterface(riid, ppvObj);
  47. }
  48. //**********************************************************************
  49. //
  50. // CConnWizApp::AddRef
  51. //
  52. // Purpose:
  53. //
  54. // Adds to the reference count at the interface level.
  55. //
  56. // Parameters:
  57. //
  58. // None
  59. //
  60. // Return Value:
  61. //
  62. // ULONG - The new reference count of the interface
  63. //
  64. // Function Calls:
  65. // Function Location
  66. //
  67. //
  68. // Comments:
  69. //
  70. //********************************************************************
  71. STDMETHODIMP_(ULONG) COleClientSite::AddRef()
  72. {
  73. TraceMsg(TF_GENERAL, "In IOCS::AddRef\r\n");
  74. // increment the interface reference count (for debugging only)
  75. ++m_nCount;
  76. // delegate to the container Site
  77. return m_pSite->AddRef();
  78. }
  79. //**********************************************************************
  80. //
  81. // CConnWizApp::Release
  82. //
  83. // Purpose:
  84. //
  85. // Decrements the reference count at this level
  86. //
  87. // Parameters:
  88. //
  89. // None
  90. //
  91. // Return Value:
  92. //
  93. // ULONG - The new reference count of the interface.
  94. //
  95. // Function Calls:
  96. // Function Location
  97. //
  98. //
  99. // Comments:
  100. //
  101. //********************************************************************
  102. STDMETHODIMP_(ULONG) COleClientSite::Release()
  103. {
  104. TraceMsg(TF_GENERAL, "In IOCS::Release\r\n");
  105. // decrement the interface reference count (for debugging only)
  106. --m_nCount;
  107. // delegate to the container Site
  108. return m_pSite->Release();
  109. }
  110. //**********************************************************************
  111. //
  112. // COleClientSite::SaveObject
  113. //
  114. // Purpose:
  115. //
  116. // Called by the object when it wants to be saved to persistant
  117. // storage
  118. //
  119. // Parameters:
  120. //
  121. // None
  122. //
  123. // Return Value:
  124. //
  125. // S_OK
  126. //
  127. //********************************************************************
  128. STDMETHODIMP COleClientSite::SaveObject()
  129. {
  130. TraceMsg(TF_GENERAL, "In IOCS::SaveObject\r\n");
  131. return (S_OK);
  132. }
  133. //**********************************************************************
  134. //
  135. // COleClientSite::GetMoniker
  136. //
  137. // Purpose:
  138. //
  139. // Not Implemented
  140. //
  141. // Parameters:
  142. //
  143. // Not Implemented
  144. //
  145. // Return Value:
  146. //
  147. // Function Calls:
  148. // Function Location
  149. //
  150. //
  151. // Comments:
  152. //
  153. // This function is not implemented because we don't support
  154. // linking.
  155. //
  156. //********************************************************************
  157. STDMETHODIMP COleClientSite::GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, LPMONIKER FAR* ppmk)
  158. {
  159. TraceMsg(TF_GENERAL, "In IOCS::GetMoniker\r\n");
  160. // need to null the out pointer
  161. *ppmk = NULL;
  162. return ResultFromScode(E_NOTIMPL);
  163. }
  164. //**********************************************************************
  165. //
  166. // COleClientSite::GetContainer
  167. //
  168. // Purpose:
  169. //
  170. // Not Implemented
  171. //
  172. // Parameters:
  173. //
  174. // Not Implemented
  175. //
  176. // Return Value:
  177. //
  178. // Not Implemented
  179. //
  180. // Function Calls:
  181. // Function Location
  182. //
  183. //
  184. // Comments:
  185. //
  186. // Not Implemented
  187. //
  188. //********************************************************************
  189. STDMETHODIMP COleClientSite::GetContainer(LPOLECONTAINER FAR* ppContainer)
  190. {
  191. TraceMsg(TF_GENERAL, "In IOCS::GetContainer\r\n");
  192. // NULL the out pointer
  193. *ppContainer = NULL;
  194. return ResultFromScode(E_NOTIMPL);
  195. }
  196. //**********************************************************************
  197. //
  198. // COleClientSite::ShowObject
  199. //
  200. // Purpose:
  201. //
  202. // Not Implemented
  203. //
  204. // Parameters:
  205. //
  206. // Not Implemented
  207. //
  208. // Return Value:
  209. //
  210. // Not Implemented
  211. //
  212. // Function Calls:
  213. // Function Location
  214. //
  215. //
  216. // Comments:
  217. //
  218. // This function is not implemented because we don't support
  219. // linking.
  220. //
  221. //********************************************************************
  222. STDMETHODIMP COleClientSite::ShowObject()
  223. {
  224. TraceMsg(TF_GENERAL, "In IOCS::ShowObject\r\n");
  225. return NOERROR;
  226. }
  227. //**********************************************************************
  228. //
  229. // COleClientSite::OnShowWindow
  230. //
  231. // Purpose:
  232. //
  233. // Object calls this method when it is opening/closing non-InPlace
  234. // Window
  235. //
  236. // Parameters:
  237. //
  238. // BOOL fShow - TRUE if Window is opening, FALSE if closing
  239. //
  240. // Return Value:
  241. //
  242. // S_OK
  243. //
  244. // Function Calls:
  245. // Function Location
  246. //
  247. // InvalidateRect Windows API
  248. // ResultFromScode OLE API
  249. //
  250. // Comments:
  251. //
  252. //********************************************************************
  253. STDMETHODIMP COleClientSite::OnShowWindow(BOOL fShow)
  254. {
  255. TraceMsg(TF_GENERAL, "In IOCS::OnShowWindow\r\n");
  256. return ResultFromScode(S_OK);
  257. }
  258. //**********************************************************************
  259. //
  260. // COleClientSite::RequestNewObjectLayout
  261. //
  262. // Purpose:
  263. //
  264. // Not Implemented
  265. //
  266. // Parameters:
  267. //
  268. // Not Implemented
  269. //
  270. // Return Value:
  271. //
  272. // Not Implemented
  273. //
  274. // Function Calls:
  275. // Function Location
  276. //
  277. //
  278. // Comments:
  279. //
  280. // Not Implemented
  281. //
  282. //********************************************************************
  283. STDMETHODIMP COleClientSite::RequestNewObjectLayout()
  284. {
  285. TraceMsg(TF_GENERAL, "In IOCS::RequestNewObjectLayout\r\n");
  286. return ResultFromScode(E_NOTIMPL);
  287. }