home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / mfc / src / isapimix.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-16  |  1.3 KB  |  55 lines

  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.  
  11. #include "stdafx.h"
  12. #include <afxisapi.h>
  13.  
  14. CHttpServerContext& CHttpServerContext::operator<<(const CLongBinary& blob)
  15. {
  16.     ISAPIASSERT(m_pStream != NULL);
  17.     if (m_pStream != NULL) *m_pStream << blob;
  18.         return *this;
  19. }
  20.  
  21. CHttpServerContext& CHttpServerContext::operator<<(const CByteArray& array)
  22. {
  23.     ISAPIASSERT(m_pStream != NULL);
  24.     if (m_pStream != NULL) *m_pStream << array;
  25.         return *this;
  26. }
  27.  
  28. CHtmlStream& CHtmlStream::operator<<(const CByteArray& array)
  29. {
  30.     int nSize = array.GetSize();
  31.     if (nSize > 0)
  32.     {
  33.         const BYTE* pStart = array.GetData();
  34.         if (pStart != NULL)
  35.             Write(pStart, nSize);
  36.     }
  37.  
  38.     return *this;
  39. }
  40.  
  41. CHtmlStream& CHtmlStream::operator<<(const CLongBinary& blob)
  42. {
  43.     if (blob.m_dwDataLength > 0 && blob.m_hData != NULL)
  44.     {
  45.         LPVOID lpData = GlobalLock(blob.m_hData);
  46.         if (lpData != NULL)
  47.         {
  48.             Write(lpData, blob.m_dwDataLength);
  49.             GlobalUnlock(blob.m_hData);
  50.         }
  51.     }
  52.  
  53.     return *this;
  54. }
  55.