Titus Information Systems, Inc.

Standard Library
TDateCtrl Class

This class is inherited from CDateTimeCtrl, and provides several additional public member functions specific to the date portion of the Date/Time dialog box control.  The date may be set and retrieved from a variety of formats.  Additionally, the date may be changed (added to or subtracted from) by a specified number of days, months, or years.  The class may be utilized either as a Date/Time dialog box control or as a stand-alone date holder.  This routine uses a four-byte date storage method known as CYMD, where the date is stored in four parts, one byte each, consisting of the century, the year in the century, the month, and the day.  For example, May 9, 2003 would be stored in four bytes with the values 20, 3, 5, and 9.  The additional public member functions are as follows:

TDateCtrl::TDateCtrl()
This is the default constructor.  It initializes the data members, sets the current date to "none", and creates a class that will manage a Date/Time dialog box control (WinFlag = TRUE).
TDateCtrl::TDateCtrl(BOOL WinFlag)
This constructor initializes the data members, sets the current date to "none", and optionally creates a class that will manage a Date/Time dialog box control based on the setting of WinFlag.
void TDateCtrl::SetWinFlag(BOOL WinFlag)
This member function optionally sets the class to manage a Date/Time dialog box control based on the setting of WinFlag.
BOOL TDateCtrl::GetWinFlag()
This member function returns the current setting of WinFlag, which tells the class whether or not it is managing a Date/Time dialog box control.
BOOL TDateCtrl::None()
This member function returns the setting of the checkbox in the Date/Time dialog box control.  If the checkbox is checked, meaning the date has been set in the Date/Time dialog box control, this function returns FALSE.  If the date has not been set, meaning the checkbox is not checked, this function returns TRUE, meaning that the date is set to "none".
COleDateTime& TDateCtrl::GetDate()
BOOL TDateCtrl::GetDate(char* DateEx)
These member functions return the date currently maintained by the class.  The first format returns a date as a COleDateTime class.  The second format sets DateEx to the date specified in the CYMD format.
BOOL TDateCtrl::SetDate(TDateCtrl& CtrlEx)
BOOL TDateCtrl::SetDate(COleDateTime& CtrlEx)
BOOL TDateCtrl::SetDate(char* CtrlEx)
BOOL TDateCtrl::SetDate()
TDateCtrl& TDateCtrl::operator=(TDateCtrl& CtrlEx)
TDateCtrl& TDateCtrl::operator=(COleDateTime& CtrlEx)
TDateCtrl& TDateCtrl::operator=(char* CtrlEx)
These member functions set the date in the class to the date specified.  When specified as char*, the date is expected in the CYMD format.  When no arguments are given, the date is set to the current date.  The value of the function reports whether or not the date was correctly specified.
void TDateCtrl::AddDate(TDateCtrl& CtrlEx)
void TDateCtrl::AddDate(COleDateTime& CtrlEx)
void TDateCtrl::AddDate(char* CtrlEx)
void TDateCtrl::AddDate(int Year, int Month, int Day)
TDateCtrl& TDateCtrl::operator+(TDateCtrl& CtrlEx)
TDateCtrl& TDateCtrl::operator+(COleDateTime& CtrlEx)
TDateCtrl& TDateCtrl::operator+(char* CtrlEx)
These member functions add the specified date to the date in the class.  When specified as char*, the date is expected in the CYMD format.
void TDateCtrl::SubtractDate(TDateCtrl& CtrlEx)
void TDateCtrl::SubtractDate(COleDateTime& CtrlEx)
void TDateCtrl::SubtractDate(char* CtrlEx)
void TDateCtrl::SubtractDate(int Year, int Month, int Day)
TDateCtrl& TDateCtrl::operator-(TDateCtrl& CtrlEx)
TDateCtrl& TDateCtrl::operator-(COleDateTime& CtrlEx)
TDateCtrl& TDateCtrl::operator-(char* CtrlEx)
These member functions subtract the specified date from the date in the class.  When specified as char*, the date is expected in the CYMD format.
BOOL TDateCtrl::operator==(TDateCtrl& CtrlEx)
BOOL TDateCtrl::operator!=(TDateCtrl& CtrlEx)
BOOL TDateCtrl::operator>(TDateCtrl& CtrlEx)
BOOL TDateCtrl::operator<(TDateCtrl& CtrlEx)
BOOL TDateCtrl::operator>=(TDateCtrl& CtrlEx)
BOOL TDateCtrl::operator<=(TDateCtrl& CtrlEx)
These member functions compare the specified date with the date in the class.  When specified as char*, the date is expected in the CYMD format.  The value of the function specifies the result of the comparison.


[ CBinaryFile | TCommandLineInfo | CCommaFile | CDataFile | CDDE | CDdeClient | CDdeServer ]
[ CDirectoryLocator | CDirectoryDialog | CDirectoryFind | CDirectoryNew | CFileCopy | TFrameWnd ]
[ InterfaceExcel | CMaintFn | CPrintFile | CProcDialog | TPrintDialog | CProcPropertyPage ]
[ CProgress | CRegistry | CSDisCreate | CSDisFile | CSDisPage | CSDisView | CTableFile ]
[ CTaskIcon | TPresent | TTime | TDate | TDateTime | CTransferData | TWinApp | CXlTable ]

[ Stand-alone Programs | Standard Library | Conversion Functions | Utility Functions | COBOL Functions ]
[ Windows NT Library | COBOL Library | COBOL Interface | Command Prompt Abbreviations | Purchase Instructions ]

[ Home | Areas of Expertise | "We Do Windows" | Clients and Projects | Software Samples | Package Software Available ]
[ Contact Information | Business Software Philosophy | Church Software Philosophy ]
All contents of this web site are Copyright © Titus Information Systems, Inc., Phoenix, Arizona, U.S.A.