Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COM date manipulation

Status
Not open for further replies.

Robertus

Programmer
Feb 16, 2001
81
0
0
RO
Does anyone know how could I manipulate times and time spans in an ATL COM AppWizard generated SERVICE (.EXE) project??
I use COleDateTime but it seems it is NOT recognized!!!
 
COleDateTime is an MFC class. To use it, you have to configure the ATL AppWizard to use MFC when creating your ATL project.
 
But when I specify SERVICE (.exe) the "Support MFC" checkbox is DISABLED, so I guess I am not allowed to use MFC for a service...
 
Times themselves are relatively easy, check out VariantToSystemTime and SystemTimeToVariant.
COM represents these as DATE type, which is "double". The whole part in n days since 30/12/1899, and the fractional part is an encoded time.

As a worst case, you could always copy+paste the MFC source for COLEDateTime.

Steve S
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top