home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 27 / IOPROG_27.ISO / SOFT / ADSDK.ZIP / Samples / General / ADQI / ADsLargeInteger.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-04-01  |  1.8 KB  |  92 lines

  1. // ADsLargeInteger.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "ADQI.h"
  6. #include "ADsLargeInteger.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CDlgIADsLargeInteger dialog
  16.  
  17.  
  18. CDlgIADsLargeInteger::CDlgIADsLargeInteger( LPUNKNOWN pUnk, CWnd* pParent /*=NULL*/)
  19.     : CDialog(CDlgIADsLargeInteger::IDD, pParent)
  20. {
  21.     //{{AFX_DATA_INIT(CDlgIADsLargeInteger)
  22.     m_lHiPart = 0;
  23.     m_lLowPart = 0;
  24.     //}}AFX_DATA_INIT
  25.  
  26.  
  27.     HRESULT hr;    
  28.     m_pLargeInt = NULL;
  29.  
  30.     
  31.     hr = pUnk->QueryInterface( IID_IADsLargeInteger, (void **) &m_pLargeInt );
  32.     pUnk->Release();
  33.  
  34.     if ( !SUCCEEDED(hr) )
  35.     {
  36.         AfxMessageBox(_T("Fatal Error! QI for IADsLargeInteger failed"));
  37.         return;
  38.     }
  39.  
  40.  
  41.     
  42.  
  43. }
  44.  
  45. CDlgIADsLargeInteger::~CDlgIADsLargeInteger()
  46. {
  47.     if ( m_pLargeInt )
  48.     {
  49.         m_pLargeInt->Release();
  50.     }
  51. }
  52.  
  53.  
  54. void CDlgIADsLargeInteger::DoDataExchange(CDataExchange* pDX)
  55. {
  56.     CDialog::DoDataExchange(pDX);
  57.     //{{AFX_DATA_MAP(CDlgIADsLargeInteger)
  58.     DDX_Text(pDX, IDC_HIPART, m_lHiPart);
  59.     DDX_Text(pDX, IDC_LOWPART, m_lLowPart);
  60.     //}}AFX_DATA_MAP
  61. }
  62.  
  63.  
  64. BEGIN_MESSAGE_MAP(CDlgIADsLargeInteger, CDialog)
  65.     //{{AFX_MSG_MAP(CDlgIADsLargeInteger)
  66.     //}}AFX_MSG_MAP
  67. END_MESSAGE_MAP()
  68.  
  69. /////////////////////////////////////////////////////////////////////////////
  70. // CDlgIADsLargeInteger message handlers
  71.  
  72. void CDlgIADsLargeInteger::OnOK() 
  73. {
  74.     
  75.     CDialog::OnOK();
  76. }
  77.  
  78. BOOL CDlgIADsLargeInteger::OnInitDialog() 
  79. {
  80.     CDialog::OnInitDialog();
  81.     
  82.     if ( m_pLargeInt )
  83.     {
  84.         m_pLargeInt->get_HighPart( &m_lHiPart );
  85.         m_pLargeInt->get_LowPart( &m_lLowPart );
  86.         UpdateData(FALSE);
  87.     }
  88.     
  89.     return TRUE;  // return TRUE unless you set the focus to a control
  90.                   // EXCEPTION: OCX Property Pages should return FALSE
  91. }
  92.