Click here to Skip to main content
15,915,019 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Opening a file to write to Pin
PremL27-Aug-03 6:03
PremL27-Aug-03 6:03 
GeneralCTimeSpan usage Pin
JensB27-Aug-03 5:04
JensB27-Aug-03 5:04 
GeneralRe: CTimeSpan usage Pin
Roger Wright27-Aug-03 5:20
professionalRoger Wright27-Aug-03 5:20 
GeneralRe: CTimeSpan usage Pin
RChin27-Aug-03 5:20
RChin27-Aug-03 5:20 
GeneralRe: CTimeSpan usage Pin
Anonymous27-Aug-03 19:09
Anonymous27-Aug-03 19:09 
GeneralRe: CTimeSpan usage Pin
Anonymous27-Aug-03 19:10
Anonymous27-Aug-03 19:10 
GeneralRe: CTimeSpan usage Pin
JensB27-Aug-03 21:05
JensB27-Aug-03 21:05 
GeneralRe: CTimeSpan usage Pin
RChin27-Aug-03 22:39
RChin27-Aug-03 22:39 
JensB,
I have just quickly built a console version of your program above and it seems to be OK? I had to add an extra parameter at the construction of your CTimeSpan, dtDiff (it takes four parameters).

<br />
CTimeSpan dtDiff(60,0,0,0);<br />
CTime timeNow(1999,3,23,7,34,12); // construct a valid date<br />
CTime dtResult = timeNow - dtDiff;<br />
char szMsg[256];<br />
<br />
wsprintf(szMsg, "%02d/%02d/%04d", dtResult.GetDay(), dtResult.GetMonth(), dtResult.GetYear());<br />


The only thing that have noticed is that the MSDN says that the time classes will assert if any of the time conponents are invalid or out of range. Maybe this is what you are experiencing...


I Dream of Absolute Zero



GeneralRe: CTimeSpan usage Pin
JensB27-Aug-03 22:53
JensB27-Aug-03 22:53 
GeneralConsole app Q (newbie) Pin
sallas27-Aug-03 3:56
sallas27-Aug-03 3:56 
GeneralRe: Console app Q (newbie) Pin
David Crow27-Aug-03 4:17
David Crow27-Aug-03 4:17 
GeneralRe: Console app Q (newbie) Pin
sallas27-Aug-03 6:00
sallas27-Aug-03 6:00 
Generalinitialising memory block using malloc Pin
Dangleberry27-Aug-03 3:22
sussDangleberry27-Aug-03 3:22 
GeneralRe: initialising memory block using malloc Pin
Magnus Westin27-Aug-03 3:26
Magnus Westin27-Aug-03 3:26 
GeneralRe: initialising memory block using malloc Pin
Joaquín M López Muñoz27-Aug-03 3:33
Joaquín M López Muñoz27-Aug-03 3:33 
GeneralRe: initialising memory block using malloc Pin
Dangleberry28-Aug-03 7:51
sussDangleberry28-Aug-03 7:51 
GeneralCalling one exe from other Pin
rohit.dhamija27-Aug-03 2:44
rohit.dhamija27-Aug-03 2:44 
GeneralRe: Calling one exe from other Pin
Magnus Westin27-Aug-03 2:54
Magnus Westin27-Aug-03 2:54 
GeneralProcess End Pin
Andrew Walker27-Aug-03 3:00
Andrew Walker27-Aug-03 3:00 
GeneralRe: Process End Pin
Nish Nishant27-Aug-03 3:05
sitebuilderNish Nishant27-Aug-03 3:05 
GeneralRe: Process End Pin
Andrew Walker27-Aug-03 3:17
Andrew Walker27-Aug-03 3:17 
GeneralRe: Process End Pin
iceage27-Aug-03 3:06
iceage27-Aug-03 3:06 
GeneralRe: Process End Pin
Magnus Westin27-Aug-03 3:09
Magnus Westin27-Aug-03 3:09 
GeneralRe: Process End Pin
vcplusplus27-Aug-03 3:27
vcplusplus27-Aug-03 3:27 
QuestionUpdating the property window from my custom property page? Pin
Daed27-Aug-03 2:41
Daed27-Aug-03 2:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.