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.

432 lines
18 KiB

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. // Inlines for AFXOLE.H
  11. /////////////////////////////////////////////////////////////////////////////
  12. // General OLE inlines (CDocItem, COleDocument)
  13. #ifdef _AFXOLE_INLINE
  14. // CDocItem
  15. _AFXOLE_INLINE CDocument* CDocItem::GetDocument() const
  16. { return m_pDocument; }
  17. // COleDocument
  18. _AFXOLE_INLINE void COleDocument::EnableCompoundFile(BOOL bEnable)
  19. { m_bCompoundFile = bEnable; }
  20. // COleMessageFilter
  21. _AFXOLE_INLINE void COleMessageFilter::SetBusyReply(SERVERCALL nBusyReply)
  22. { ASSERT_VALID(this); m_nBusyReply = nBusyReply; }
  23. _AFXOLE_INLINE void COleMessageFilter::SetRetryReply(DWORD nRetryReply)
  24. { ASSERT_VALID(this); m_nRetryReply = nRetryReply; }
  25. _AFXOLE_INLINE void COleMessageFilter::SetMessagePendingDelay(DWORD nTimeout)
  26. { ASSERT_VALID(this); m_nTimeout = nTimeout; }
  27. _AFXOLE_INLINE void COleMessageFilter::EnableBusyDialog(BOOL bEnable)
  28. { ASSERT_VALID(this); m_bEnableBusy = bEnable; }
  29. _AFXOLE_INLINE void COleMessageFilter::EnableNotRespondingDialog(BOOL bEnable)
  30. { ASSERT_VALID(this); m_bEnableNotResponding = bEnable; }
  31. #endif //_AFXOLE_INLINE
  32. /////////////////////////////////////////////////////////////////////////////
  33. // OLE Moniker inlines
  34. #ifdef _AFXOLEMONIKER_INLINE
  35. // CMonikerFile
  36. _AFXOLEMONIKER_INLINE CMonikerFile::CMonikerFile() { }
  37. _AFXOLEMONIKER_INLINE IMoniker* CMonikerFile::GetMoniker() const
  38. { ASSERT_VALID(this); return m_Moniker; }
  39. // CAsyncMonikerFile
  40. _AFXOLEMONIKER_INLINE IBinding* CAsyncMonikerFile::GetBinding() const
  41. { ASSERT_VALID(this); return m_Binding; }
  42. _AFXOLEMONIKER_INLINE void CAsyncMonikerFile::SetBinding(IBinding* pBinding)
  43. { ASSERT_VALID(this); m_Binding=pBinding; }
  44. _AFXOLEMONIKER_INLINE void CAsyncMonikerFile::SetFormatEtc(FORMATETC* pFormatEtc)
  45. { ASSERT_VALID(this); m_pFormatEtc=pFormatEtc; }
  46. _AFXOLEMONIKER_INLINE FORMATETC* CAsyncMonikerFile::GetFormatEtc() const
  47. { ASSERT_VALID(this); return m_pFormatEtc; }
  48. #endif //_AFXOLEMONIKER_INLINE
  49. /////////////////////////////////////////////////////////////////////////////
  50. // OLE automation inlines
  51. #ifdef _AFXDISP_INLINE
  52. // COleException
  53. _AFXDISP_INLINE COleException::COleException()
  54. { m_sc = S_OK; }
  55. _AFXDISP_INLINE COleException::~COleException()
  56. { }
  57. // CCmdTarget
  58. _AFXDISP_INLINE DWORD CCmdTarget::InternalAddRef()
  59. { ASSERT(GetInterfaceMap() != NULL); return InterlockedIncrement(&m_dwRef); }
  60. // CObjectFactory
  61. _AFXDISP_INLINE BOOL COleObjectFactory::IsRegistered() const
  62. { ASSERT_VALID(this); return m_dwRegister != 0; }
  63. _AFXDISP_INLINE REFCLSID COleObjectFactory::GetClassID() const
  64. { ASSERT_VALID(this); return m_clsid; }
  65. // COleDispatchDriver
  66. _AFXDISP_INLINE COleDispatchDriver::~COleDispatchDriver()
  67. { ReleaseDispatch(); }
  68. _AFXDISP_INLINE COleDispatchDriver::operator LPDISPATCH()
  69. { return m_lpDispatch; }
  70. // COleVariant
  71. _AFXDISP_INLINE COleVariant::COleVariant()
  72. { AfxVariantInit(this); }
  73. _AFXDISP_INLINE COleVariant::~COleVariant()
  74. { VERIFY(::VariantClear(this) == NOERROR); }
  75. _AFXDISP_INLINE void COleVariant::Clear()
  76. { VERIFY(::VariantClear(this) == NOERROR); }
  77. _AFXDISP_INLINE COleVariant::COleVariant(LPCTSTR lpszSrc)
  78. { vt = VT_EMPTY; *this = lpszSrc; }
  79. _AFXDISP_INLINE COleVariant::COleVariant(CString& strSrc)
  80. { vt = VT_EMPTY; *this = strSrc; }
  81. _AFXDISP_INLINE COleVariant::COleVariant(BYTE nSrc)
  82. { vt = VT_UI1; bVal = nSrc; }
  83. _AFXDISP_INLINE COleVariant::COleVariant(const COleCurrency& curSrc)
  84. { vt = VT_CY; cyVal = curSrc.m_cur; }
  85. _AFXDISP_INLINE COleVariant::COleVariant(float fltSrc)
  86. { vt = VT_R4; fltVal = fltSrc; }
  87. _AFXDISP_INLINE COleVariant::COleVariant(double dblSrc)
  88. { vt = VT_R8; dblVal = dblSrc; }
  89. _AFXDISP_INLINE COleVariant::COleVariant(const COleDateTime& dateSrc)
  90. { vt = VT_DATE; date = dateSrc.m_dt; }
  91. _AFXDISP_INLINE COleVariant::COleVariant(const CByteArray& arrSrc)
  92. { vt = VT_EMPTY; *this = arrSrc; }
  93. _AFXDISP_INLINE COleVariant::COleVariant(const CLongBinary& lbSrc)
  94. { vt = VT_EMPTY; *this = lbSrc; }
  95. _AFXDISP_INLINE BOOL COleVariant::operator==(LPCVARIANT pSrc) const
  96. { return *this == *pSrc; }
  97. _AFXDISP_INLINE COleVariant::operator LPVARIANT()
  98. { return this; }
  99. _AFXDISP_INLINE COleVariant::operator LPCVARIANT() const
  100. { return this; }
  101. // COleCurrency
  102. _AFXDISP_INLINE COleCurrency::COleCurrency()
  103. { m_cur.Hi = 0; m_cur.Lo = 0; SetStatus(valid); }
  104. _AFXDISP_INLINE COleCurrency::COleCurrency(CURRENCY cySrc)
  105. { m_cur = cySrc; SetStatus(valid); }
  106. _AFXDISP_INLINE COleCurrency::COleCurrency(const COleCurrency& curSrc)
  107. { m_cur = curSrc.m_cur; m_status = curSrc.m_status; }
  108. _AFXDISP_INLINE COleCurrency::COleCurrency(const VARIANT& varSrc)
  109. { *this = varSrc; }
  110. _AFXDISP_INLINE COleCurrency::CurrencyStatus COleCurrency::GetStatus() const
  111. { return m_status; }
  112. _AFXDISP_INLINE void COleCurrency::SetStatus(CurrencyStatus status)
  113. { m_status = status; }
  114. _AFXDISP_INLINE const COleCurrency& COleCurrency::operator+=(const COleCurrency& cur)
  115. { *this = *this + cur; return *this; }
  116. _AFXDISP_INLINE const COleCurrency& COleCurrency::operator-=(const COleCurrency& cur)
  117. { *this = *this - cur; return *this; }
  118. _AFXDISP_INLINE const COleCurrency& COleCurrency::operator*=(long nOperand)
  119. { *this = *this * nOperand; return *this; }
  120. _AFXDISP_INLINE const COleCurrency& COleCurrency::operator/=(long nOperand)
  121. { *this = *this / nOperand; return *this; }
  122. _AFXDISP_INLINE BOOL COleCurrency::operator==(const COleCurrency& cur) const
  123. { return(m_status == cur.m_status && m_cur.Hi == cur.m_cur.Hi &&
  124. m_cur.Lo == cur.m_cur.Lo); }
  125. _AFXDISP_INLINE BOOL COleCurrency::operator!=(const COleCurrency& cur) const
  126. { return(m_status != cur.m_status || m_cur.Hi != cur.m_cur.Hi ||
  127. m_cur.Lo != cur.m_cur.Lo); }
  128. _AFXDISP_INLINE COleCurrency::operator CURRENCY() const
  129. { return m_cur; }
  130. // COleDateTime
  131. _AFXDISP_INLINE COleDateTime::COleDateTime()
  132. { m_dt = 0; SetStatus(valid); }
  133. _AFXDISP_INLINE COleDateTime::COleDateTime(const COleDateTime& dateSrc)
  134. { m_dt = dateSrc.m_dt; m_status = dateSrc.m_status; }
  135. _AFXDISP_INLINE COleDateTime::COleDateTime(const VARIANT& varSrc)
  136. { *this = varSrc; }
  137. _AFXDISP_INLINE COleDateTime::COleDateTime(DATE dtSrc)
  138. { m_dt = dtSrc; SetStatus(valid); }
  139. _AFXDISP_INLINE COleDateTime::COleDateTime(time_t timeSrc)
  140. { *this = timeSrc; }
  141. _AFXDISP_INLINE COleDateTime::COleDateTime(const SYSTEMTIME& systimeSrc)
  142. { *this = systimeSrc; }
  143. _AFXDISP_INLINE COleDateTime::COleDateTime(const FILETIME& filetimeSrc)
  144. { *this = filetimeSrc; }
  145. _AFXDISP_INLINE COleDateTime::COleDateTime(int nYear, int nMonth, int nDay,
  146. int nHour, int nMin, int nSec)
  147. { SetDateTime(nYear, nMonth, nDay, nHour, nMin, nSec); }
  148. _AFXDISP_INLINE COleDateTime::COleDateTime(WORD wDosDate, WORD wDosTime)
  149. { m_status = DosDateTimeToVariantTime(wDosDate, wDosTime, &m_dt) ?
  150. valid : invalid; }
  151. _AFXDISP_INLINE const COleDateTime& COleDateTime::operator=(const COleDateTime& dateSrc)
  152. { m_dt = dateSrc.m_dt; m_status = dateSrc.m_status; return *this; }
  153. _AFXDISP_INLINE COleDateTime::DateTimeStatus COleDateTime::GetStatus() const
  154. { return m_status; }
  155. _AFXDISP_INLINE void COleDateTime::SetStatus(DateTimeStatus status)
  156. { m_status = status; }
  157. _AFXDISP_INLINE BOOL COleDateTime::operator==(const COleDateTime& date) const
  158. { return (m_status == date.m_status && m_dt == date.m_dt); }
  159. _AFXDISP_INLINE BOOL COleDateTime::operator!=(const COleDateTime& date) const
  160. { return (m_status != date.m_status || m_dt != date.m_dt); }
  161. _AFXDISP_INLINE const COleDateTime& COleDateTime::operator+=(
  162. const COleDateTimeSpan dateSpan)
  163. { *this = *this + dateSpan; return *this; }
  164. _AFXDISP_INLINE const COleDateTime& COleDateTime::operator-=(
  165. const COleDateTimeSpan dateSpan)
  166. { *this = *this - dateSpan; return *this; }
  167. _AFXDISP_INLINE COleDateTime::operator DATE() const
  168. { return m_dt; }
  169. _AFXDISP_INLINE int COleDateTime::SetDate(int nYear, int nMonth, int nDay)
  170. { return SetDateTime(nYear, nMonth, nDay, 0, 0, 0); }
  171. _AFXDISP_INLINE int COleDateTime::SetTime(int nHour, int nMin, int nSec)
  172. // Set date to zero date - 12/30/1899
  173. { return SetDateTime(1899, 12, 30, nHour, nMin, nSec); }
  174. // COleDateTimeSpan
  175. _AFXDISP_INLINE COleDateTimeSpan::COleDateTimeSpan()
  176. { m_span = 0; SetStatus(valid); }
  177. _AFXDISP_INLINE COleDateTimeSpan::COleDateTimeSpan(double dblSpanSrc)
  178. { m_span = dblSpanSrc; SetStatus(valid); }
  179. _AFXDISP_INLINE COleDateTimeSpan::COleDateTimeSpan(
  180. const COleDateTimeSpan& dateSpanSrc)
  181. { m_span = dateSpanSrc.m_span; m_status = dateSpanSrc.m_status; }
  182. _AFXDISP_INLINE COleDateTimeSpan::COleDateTimeSpan(
  183. long lDays, int nHours, int nMins, int nSecs)
  184. { SetDateTimeSpan(lDays, nHours, nMins, nSecs); }
  185. _AFXDISP_INLINE COleDateTimeSpan::DateTimeSpanStatus COleDateTimeSpan::GetStatus() const
  186. { return m_status; }
  187. _AFXDISP_INLINE void COleDateTimeSpan::SetStatus(DateTimeSpanStatus status)
  188. { m_status = status; }
  189. _AFXDISP_INLINE double COleDateTimeSpan::GetTotalDays() const
  190. { ASSERT(GetStatus() == valid); return m_span; }
  191. #if _MFC_VER >= 0x0600
  192. _AFXDISP_INLINE double COleDateTimeSpan::GetTotalHours() const
  193. { ASSERT(GetStatus() == valid);
  194. long lReturns = (long)(m_span * 24 + AFX_OLE_DATETIME_HALFSECOND);
  195. return lReturns;
  196. }
  197. _AFXDISP_INLINE double COleDateTimeSpan::GetTotalMinutes() const
  198. { ASSERT(GetStatus() == valid);
  199. long lReturns = (long)(m_span * 24 * 60 + AFX_OLE_DATETIME_HALFSECOND);
  200. return lReturns;
  201. }
  202. _AFXDISP_INLINE double COleDateTimeSpan::GetTotalSeconds() const
  203. { ASSERT(GetStatus() == valid);
  204. long lReturns = (long)(m_span * 24 * 60 * 60 + AFX_OLE_DATETIME_HALFSECOND);
  205. return lReturns;
  206. }
  207. #else
  208. _AFXDISP_INLINE double COleDateTimeSpan::GetTotalHours() const
  209. { ASSERT(GetStatus() == valid); return m_span * 24; }
  210. _AFXDISP_INLINE double COleDateTimeSpan::GetTotalMinutes() const
  211. { ASSERT(GetStatus() == valid); return m_span * 24 * 60; }
  212. _AFXDISP_INLINE double COleDateTimeSpan::GetTotalSeconds() const
  213. { ASSERT(GetStatus() == valid); return m_span * 24 * 60 * 60; }
  214. #endif
  215. _AFXDISP_INLINE long COleDateTimeSpan::GetDays() const
  216. { ASSERT(GetStatus() == valid); return (long)m_span; }
  217. _AFXDISP_INLINE BOOL COleDateTimeSpan::operator==(
  218. const COleDateTimeSpan& dateSpan) const
  219. { return (m_status == dateSpan.m_status &&
  220. m_span == dateSpan.m_span); }
  221. _AFXDISP_INLINE BOOL COleDateTimeSpan::operator!=(
  222. const COleDateTimeSpan& dateSpan) const
  223. { return (m_status != dateSpan.m_status ||
  224. m_span != dateSpan.m_span); }
  225. _AFXDISP_INLINE BOOL COleDateTimeSpan::operator<(
  226. const COleDateTimeSpan& dateSpan) const
  227. { ASSERT(GetStatus() == valid);
  228. ASSERT(dateSpan.GetStatus() == valid);
  229. return m_span < dateSpan.m_span; }
  230. _AFXDISP_INLINE BOOL COleDateTimeSpan::operator>(
  231. const COleDateTimeSpan& dateSpan) const
  232. { ASSERT(GetStatus() == valid);
  233. ASSERT(dateSpan.GetStatus() == valid);
  234. return m_span > dateSpan.m_span; }
  235. _AFXDISP_INLINE BOOL COleDateTimeSpan::operator<=(
  236. const COleDateTimeSpan& dateSpan) const
  237. { ASSERT(GetStatus() == valid);
  238. ASSERT(dateSpan.GetStatus() == valid);
  239. return m_span <= dateSpan.m_span; }
  240. _AFXDISP_INLINE BOOL COleDateTimeSpan::operator>=(
  241. const COleDateTimeSpan& dateSpan) const
  242. { ASSERT(GetStatus() == valid);
  243. ASSERT(dateSpan.GetStatus() == valid);
  244. return m_span >= dateSpan.m_span; }
  245. _AFXDISP_INLINE const COleDateTimeSpan& COleDateTimeSpan::operator+=(
  246. const COleDateTimeSpan dateSpan)
  247. { *this = *this + dateSpan; return *this; }
  248. _AFXDISP_INLINE const COleDateTimeSpan& COleDateTimeSpan::operator-=(
  249. const COleDateTimeSpan dateSpan)
  250. { *this = *this - dateSpan; return *this; }
  251. _AFXDISP_INLINE COleDateTimeSpan COleDateTimeSpan::operator-() const
  252. { return -this->m_span; }
  253. _AFXDISP_INLINE COleDateTimeSpan::operator double() const
  254. { return m_span; }
  255. // COleSafeArray
  256. _AFXDISP_INLINE COleSafeArray::COleSafeArray()
  257. { AfxSafeArrayInit(this);
  258. vt = VT_EMPTY; }
  259. _AFXDISP_INLINE COleSafeArray::~COleSafeArray()
  260. { Clear(); }
  261. _AFXDISP_INLINE void COleSafeArray::Clear()
  262. { VERIFY(::VariantClear(this) == NOERROR); }
  263. _AFXDISP_INLINE COleSafeArray::operator LPVARIANT()
  264. { return this; }
  265. _AFXDISP_INLINE COleSafeArray::operator LPCVARIANT() const
  266. { return this; }
  267. _AFXDISP_INLINE DWORD COleSafeArray::GetDim()
  268. { return ::SafeArrayGetDim(parray); }
  269. _AFXDISP_INLINE DWORD COleSafeArray::GetElemSize()
  270. { return ::SafeArrayGetElemsize(parray); }
  271. #endif //_AFXDISP_INLINE
  272. /////////////////////////////////////////////////////////////////////////////
  273. // OLE Container inlines
  274. #ifdef _AFXOLECLI_INLINE
  275. // COleClientItem
  276. _AFXOLECLI_INLINE SCODE COleClientItem::GetLastStatus() const
  277. { ASSERT_VALID(this); return m_scLast; }
  278. _AFXOLECLI_INLINE COleDocument* COleClientItem::GetDocument() const
  279. { ASSERT_VALID(this); return (COleDocument*)m_pDocument; }
  280. _AFXOLECLI_INLINE OLE_OBJTYPE COleClientItem::GetType() const
  281. { ASSERT_VALID(this); return m_nItemType; }
  282. _AFXOLECLI_INLINE DVASPECT COleClientItem::GetDrawAspect() const
  283. { ASSERT_VALID(this); return m_nDrawAspect; }
  284. _AFXOLECLI_INLINE BOOL COleClientItem::IsRunning() const
  285. { ASSERT_VALID(this);
  286. ASSERT(m_lpObject != NULL);
  287. return ::OleIsRunning(m_lpObject); }
  288. _AFXOLECLI_INLINE UINT COleClientItem::GetItemState() const
  289. { ASSERT_VALID(this); return m_nItemState; }
  290. _AFXOLECLI_INLINE BOOL COleClientItem::IsInPlaceActive() const
  291. { ASSERT_VALID(this);
  292. return m_nItemState == activeState || m_nItemState == activeUIState; }
  293. _AFXOLECLI_INLINE BOOL COleClientItem::IsOpen() const
  294. { ASSERT_VALID(this); return m_nItemState == openState; }
  295. _AFXOLECLI_INLINE BOOL COleClientItem::IsLinkUpToDate() const
  296. { ASSERT_VALID(this);
  297. ASSERT(m_lpObject != NULL);
  298. // TRUE if result is S_OK (aka S_TRUE)
  299. return m_lpObject->IsUpToDate() == NOERROR; }
  300. _AFXOLECLI_INLINE CView* COleClientItem::GetActiveView() const
  301. { return m_pView; }
  302. // COleLinkingDoc
  303. _AFXOLECLI_INLINE void COleLinkingDoc::BeginDeferErrors()
  304. { ASSERT(m_pLastException == NULL); ++m_bDeferErrors; }
  305. #endif //_AFXOLECLI_INLINE
  306. #ifdef _AFXOLEDOBJ_INLINE
  307. // COleDataObject
  308. _AFXOLEDOBJ_INLINE COleDataObject::~COleDataObject()
  309. { Release(); }
  310. #endif //_AFXOLECTL_INLINE
  311. /////////////////////////////////////////////////////////////////////////////
  312. // OLE dialog inlines
  313. #ifdef _AFXODLGS_INLINE
  314. _AFXODLGS_INLINE UINT COleDialog::GetLastError() const
  315. { return m_nLastError; }
  316. _AFXODLGS_INLINE CString COleInsertDialog::GetPathName() const
  317. { ASSERT_VALID(this);
  318. ASSERT(GetSelectionType() != createNewItem); return m_szFileName; }
  319. _AFXODLGS_INLINE REFCLSID COleInsertDialog::GetClassID() const
  320. { ASSERT_VALID(this); return m_io.clsid; }
  321. _AFXODLGS_INLINE HGLOBAL COleInsertDialog::GetIconicMetafile() const
  322. { ASSERT_VALID(this); return m_io.hMetaPict; }
  323. _AFXODLGS_INLINE DVASPECT COleInsertDialog::GetDrawAspect() const
  324. { ASSERT_VALID(this); return m_io.dwFlags & IOF_CHECKDISPLAYASICON ?
  325. DVASPECT_ICON : DVASPECT_CONTENT; }
  326. _AFXODLGS_INLINE HGLOBAL COleConvertDialog::GetIconicMetafile() const
  327. { ASSERT_VALID(this); return m_cv.hMetaPict; }
  328. _AFXODLGS_INLINE DVASPECT COleConvertDialog::GetDrawAspect() const
  329. { ASSERT_VALID(this); return (DVASPECT)m_cv.dvAspect; }
  330. _AFXODLGS_INLINE REFCLSID COleConvertDialog::GetClassID() const
  331. { ASSERT_VALID(this); return m_cv.clsidNew; }
  332. _AFXODLGS_INLINE HGLOBAL COleChangeIconDialog::GetIconicMetafile() const
  333. { ASSERT_VALID(this); return m_ci.hMetaPict; }
  334. _AFXODLGS_INLINE int COlePasteSpecialDialog::GetPasteIndex() const
  335. { ASSERT_VALID(this); return m_ps.nSelectedIndex; }
  336. _AFXODLGS_INLINE DVASPECT COlePasteSpecialDialog::GetDrawAspect() const
  337. { ASSERT_VALID(this); return m_ps.dwFlags & PSF_CHECKDISPLAYASICON ?
  338. DVASPECT_ICON : DVASPECT_CONTENT; }
  339. _AFXODLGS_INLINE HGLOBAL COlePasteSpecialDialog::GetIconicMetafile() const
  340. { ASSERT_VALID(this); return m_ps.hMetaPict; }
  341. _AFXODLGS_INLINE UINT COleBusyDialog::GetSelectionType() const
  342. { ASSERT_VALID(this); return m_selection; }
  343. _AFXODLGS_INLINE BOOL COleChangeSourceDialog::IsValidSource()
  344. { return m_cs.dwFlags & CSF_VALIDSOURCE; }
  345. _AFXODLGS_INLINE CString COleChangeSourceDialog::GetDisplayName()
  346. { return m_cs.lpszDisplayName; }
  347. _AFXODLGS_INLINE CString COleChangeSourceDialog::GetFileName()
  348. { return CString(m_cs.lpszDisplayName, m_cs.nFileLength); }
  349. _AFXODLGS_INLINE CString COleChangeSourceDialog::GetItemName()
  350. { return m_cs.lpszDisplayName+m_cs.nFileLength; }
  351. _AFXODLGS_INLINE CString COleChangeSourceDialog::GetFromPrefix()
  352. { return m_cs.lpszFrom; }
  353. _AFXODLGS_INLINE CString COleChangeSourceDialog::GetToPrefix()
  354. { return m_cs.lpszTo; }
  355. #endif //_AFXODLGS_INLINE
  356. /////////////////////////////////////////////////////////////////////////////
  357. // OLE Server inlines
  358. #ifdef _AFXOLESVR_INLINE
  359. // COleServerItem
  360. _AFXOLESVR_INLINE COleServerDoc* COleServerItem::GetDocument() const
  361. { ASSERT_VALID(this); return (COleServerDoc*)m_pDocument; }
  362. _AFXOLESVR_INLINE void COleServerItem::NotifyChanged(DVASPECT nDrawAspect)
  363. { ASSERT_VALID(this); NotifyClient(OLE_CHANGED, nDrawAspect); }
  364. _AFXOLESVR_INLINE const CString& COleServerItem::GetItemName() const
  365. { ASSERT_VALID(this); return m_strItemName; }
  366. _AFXOLESVR_INLINE void COleServerItem::SetItemName(LPCTSTR lpszItemName)
  367. {
  368. ASSERT_VALID(this);
  369. ASSERT(lpszItemName != NULL);
  370. ASSERT(AfxIsValidString(lpszItemName));
  371. m_strItemName = lpszItemName;
  372. }
  373. _AFXOLESVR_INLINE BOOL COleServerItem::IsLinkedItem() const
  374. { ASSERT_VALID(this); return GetDocument()->m_pEmbeddedItem != this; }
  375. _AFXOLESVR_INLINE COleDataSource* COleServerItem::GetDataSource()
  376. { ASSERT_VALID(this); return &m_dataSource; }
  377. // COleServerDoc
  378. _AFXOLESVR_INLINE void COleServerDoc::NotifyChanged()
  379. { ASSERT_VALID(this); NotifyAllItems(OLE_CHANGED, DVASPECT_CONTENT); }
  380. _AFXOLESVR_INLINE void COleServerDoc::NotifyClosed()
  381. { ASSERT_VALID(this); NotifyAllItems(OLE_CLOSED, 0); }
  382. _AFXOLESVR_INLINE void COleServerDoc::NotifySaved()
  383. { ASSERT_VALID(this); NotifyAllItems(OLE_SAVED, 0); }
  384. _AFXOLESVR_INLINE BOOL COleServerDoc::IsEmbedded() const
  385. { ASSERT_VALID(this); return m_bEmbedded; }
  386. _AFXOLESVR_INLINE BOOL COleServerDoc::IsDocObject() const
  387. { ASSERT_VALID(this); return (m_pDocObjectServer != NULL) ? TRUE : FALSE; }
  388. _AFXOLESVR_INLINE BOOL COleServerDoc::IsInPlaceActive() const
  389. { ASSERT_VALID(this); return m_pInPlaceFrame != NULL; }
  390. #endif //_AFXOLESVR_INLINE
  391. /////////////////////////////////////////////////////////////////////////////