home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / mfc / src / dbvar.cpp < prev    next >
C/C++ Source or Header  |  1998-06-16  |  1KB  |  57 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.  
  13. #ifdef AFX_DB_SEG
  14. #pragma code_seg(AFX_DB_SEG)
  15. #endif
  16.  
  17. #ifdef _DEBUG
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21.  
  22. #define new DEBUG_NEW
  23.  
  24. //////////////////////////////////////////////////////////////////////////////
  25. // Implementation of CDBVariant
  26.  
  27. CDBVariant::CDBVariant()
  28. {
  29.     // Initialize type and value
  30.     m_dwType = DBVT_NULL;
  31. }
  32.  
  33. void CDBVariant::Clear()
  34. {
  35.     if (m_dwType == DBVT_STRING)
  36.         delete (CString*)m_pstring;
  37.     else if (m_dwType == DBVT_BINARY)
  38.         delete (CLongBinary*)m_pbinary;
  39.     else if (m_dwType == DBVT_DATE)
  40.         delete (TIMESTAMP_STRUCT*)m_pdate;
  41.  
  42.     m_dwType = DBVT_NULL;
  43. }
  44.  
  45. CDBVariant::~CDBVariant()
  46. {
  47.     Clear();
  48. }
  49.  
  50. //////////////////////////////////////////////////////////////////////////////
  51.  
  52. #ifdef AFX_INIT_SEG
  53. #pragma code_seg(AFX_INIT_SEG)
  54. #endif
  55.  
  56. /////////////////////////////////////////////////////////////////////////////
  57.