home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / mfc / src / occddxf.cpp < prev    next >
C/C++ Source or Header  |  1998-06-16  |  2KB  |  68 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 "occimpl.h"
  13.  
  14. #ifdef AFX_OCC_SEG
  15. #pragma code_seg(AFX_OCC_SEG)
  16. #endif
  17.  
  18. #ifdef _DEBUG
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23. #define new DEBUG_NEW
  24.  
  25. #ifndef _AFX_NO_OCC_SUPPORT
  26.  
  27. void AFXAPI DDX_OCFloat(CDataExchange* pDX, int nIDC, DISPID dispid,
  28.     float &value)
  29. {
  30.     CWnd* pControl = pDX->PrepareOleCtrl(nIDC);
  31.     if (pDX->m_bSaveAndValidate)
  32.         pControl->GetProperty(dispid, VT_R4, &value);
  33.     else
  34.         pControl->SetProperty(dispid, VT_R4, value);
  35. }
  36.  
  37. void AFXAPI DDX_OCFloatRO(CDataExchange* pDX, int nIDC, DISPID dispid,
  38.     float &value)
  39. {
  40.     if (pDX->m_bSaveAndValidate)
  41.     {
  42.         CWnd* pControl = pDX->PrepareOleCtrl(nIDC);
  43.         pControl->GetProperty(dispid, VT_R4, &value);
  44.     }
  45. }
  46.  
  47. void AFXAPI DDX_OCFloat(CDataExchange* pDX, int nIDC, DISPID dispid,
  48.     double &value)
  49. {
  50.     CWnd* pControl = pDX->PrepareOleCtrl(nIDC);
  51.     if (pDX->m_bSaveAndValidate)
  52.         pControl->GetProperty(dispid, VT_R8, &value);
  53.     else
  54.         pControl->SetProperty(dispid, VT_R8, value);
  55. }
  56.  
  57. void AFXAPI DDX_OCFloatRO(CDataExchange* pDX, int nIDC, DISPID dispid,
  58.     double &value)
  59. {
  60.     if (pDX->m_bSaveAndValidate)
  61.     {
  62.         CWnd* pControl = pDX->PrepareOleCtrl(nIDC);
  63.         pControl->GetProperty(dispid, VT_R8, &value);
  64.     }
  65. }
  66.  
  67. #endif // !_AFX_NO_OCC_SUPPORT
  68.