home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / 93win / data1.cab / DLL_Toolkit / Source / HTBCalendar / HTBCalendar.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2005-03-02  |  1.6 KB  |  60 lines

  1. /**********************************************
  2. HTBCALENDAR.DLL
  3.  
  4. htbcalendar.cpp
  5.  
  6. TransEra Corporation 1999.
  7. This is the source for the HTBCalendar Dll.
  8. ***********************************************/
  9. #include "stdafx.h"
  10. #include "HTBCalendar.h"
  11. #include "ButtonControl.h"
  12. #include "YMSelector.h"
  13.  
  14. #ifdef _DEBUG
  15. #define new DEBUG_NEW
  16. #undef THIS_FILE
  17. static char THIS_FILE[] = __FILE__;
  18. #endif
  19.  
  20. BEGIN_MESSAGE_MAP(CHTBCalendarApp, CWinApp)
  21.     //{{AFX_MSG_MAP(CHTBCalendarApp)
  22.         // NOTE - the ClassWizard will add and remove mapping macros here.
  23.         //    DO NOT EDIT what you see in these blocks of generated code!
  24.     //}}AFX_MSG_MAP
  25. END_MESSAGE_MAP()
  26.  
  27. CHTBCalendarApp::CHTBCalendarApp() {
  28. }
  29.  
  30. CHTBCalendarApp theApp;
  31.  
  32.  
  33. /////////////////////////////////////////////////////////////////////////////
  34. /*
  35.     Function:        Calendar
  36.  
  37.     Description:    displays calendar
  38.  
  39.     Return type:    void 
  40.     Argument:        char * sMonthRet
  41.  
  42.     Notes:            this function will call the YMSelector class.
  43.                     This class will allow the user to select a date
  44.                     and the click an ok button.  This will return a 
  45.                     char string to HTBasic.
  46.         
  47. */
  48. void Calendar(char * sMonthRet) {
  49.  
  50.     CString sMonth;
  51.     ButtonControl Dlg;                                    // Make Handle to Dialog Box.
  52.     Dlg.DoModal();                                        // Do it!        
  53.     sMonth.Format("%s %d, %d",                            // Format CString Month, Day, Year.
  54.                 Dlg.m_ButtonControl.GetMonthString(),    // Get String containing Month.
  55.                 Dlg.m_ButtonControl.GetDate(),            // Get int representation of the Day.    
  56.                 Dlg.m_ButtonControl.GetYear());            // Get int representation of Year.
  57.  
  58.     strcpy(sMonthRet, sMonth);                            // Copy data to return string.
  59.  
  60. }