home *** CD-ROM | disk | FTP | other *** search
/ Mastering MFC Development / MMD.ISO / samples / c12 / useclock / clock.cpp next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  2.6 KB  |  134 lines

  1. // Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
  2.  
  3. // NOTE: Do not modify the contents of this file.  If this class is regenerated by
  4. //  Microsoft Visual C++, your modifications will be overwritten.
  5.  
  6.  
  7. #include "stdafx.h"
  8. #include "clock.h"
  9.  
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CClock
  12.  
  13. IMPLEMENT_DYNCREATE(CClock, CWnd)
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CClock properties
  17.  
  18. short CClock::GetAlarmHour()
  19. {
  20.     short result;
  21.     GetProperty(0x2, VT_I2, (void*)&result);
  22.     return result;
  23. }
  24.  
  25. void CClock::SetAlarmHour(short propVal)
  26. {
  27.     SetProperty(0x2, VT_I2, propVal);
  28. }
  29.  
  30. short CClock::GetAlarmMinute()
  31. {
  32.     short result;
  33.     GetProperty(0x3, VT_I2, (void*)&result);
  34.     return result;
  35. }
  36.  
  37. void CClock::SetAlarmMinute(short propVal)
  38. {
  39.     SetProperty(0x3, VT_I2, propVal);
  40. }
  41.  
  42. short CClock::GetAlarmType()
  43. {
  44.     short result;
  45.     GetProperty(0x4, VT_I2, (void*)&result);
  46.     return result;
  47. }
  48.  
  49. void CClock::SetAlarmType(short propVal)
  50. {
  51.     SetProperty(0x4, VT_I2, propVal);
  52. }
  53.  
  54. CString CClock::GetAlarmSound()
  55. {
  56.     CString result;
  57.     GetProperty(0x5, VT_BSTR, (void*)&result);
  58.     return result;
  59. }
  60.  
  61. void CClock::SetAlarmSound(LPCTSTR propVal)
  62. {
  63.     SetProperty(0x5, VT_BSTR, propVal);
  64. }
  65.  
  66. CString CClock::GetAlarmCommand()
  67. {
  68.     CString result;
  69.     GetProperty(0x6, VT_BSTR, (void*)&result);
  70.     return result;
  71. }
  72.  
  73. void CClock::SetAlarmCommand(LPCTSTR propVal)
  74. {
  75.     SetProperty(0x6, VT_BSTR, propVal);
  76. }
  77.  
  78. BOOL CClock::GetAlarmSet()
  79. {
  80.     BOOL result;
  81.     GetProperty(0x1, VT_BOOL, (void*)&result);
  82.     return result;
  83. }
  84.  
  85. void CClock::SetAlarmSet(BOOL propVal)
  86. {
  87.     SetProperty(0x1, VT_BOOL, propVal);
  88. }
  89.  
  90. BOOL CClock::Get_AlarmSet()
  91. {
  92.     BOOL result;
  93.     GetProperty(0x0, VT_BOOL, (void*)&result);
  94.     return result;
  95. }
  96.  
  97. void CClock::Set_AlarmSet(BOOL propVal)
  98. {
  99.     SetProperty(0x0, VT_BOOL, propVal);
  100. }
  101.  
  102. OLE_COLOR CClock::GetBackColor()
  103. {
  104.     OLE_COLOR result;
  105.     GetProperty(DISPID_BACKCOLOR, VT_I4, (void*)&result);
  106.     return result;
  107. }
  108.  
  109. void CClock::SetBackColor(OLE_COLOR propVal)
  110. {
  111.     SetProperty(DISPID_BACKCOLOR, VT_I4, propVal);
  112. }
  113.  
  114. /////////////////////////////////////////////////////////////////////////////
  115. // CClock operations
  116.  
  117. void CClock::SetAlarmTime(short hour, short nNewValue)
  118. {
  119.     static BYTE parms[] =
  120.         VTS_I2 VTS_I2;
  121.     InvokeHelper(0x8, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
  122.          hour, nNewValue);
  123. }
  124.  
  125. void CClock::TestAlarm()
  126. {
  127.     InvokeHelper(0x7, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
  128. }
  129.  
  130. void CClock::AboutBox()
  131. {
  132.     InvokeHelper(0xfffffdd8, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
  133. }
  134.