Reputation: 5274
I have a need to use CTime in my code. I tried to add the header file "atltime.h" to this code. But now, I am getting so many errors in compiling. Every error is coming from the header file "afxconv.h". I searched msdn for CTime, but they didn't describe about this( may be I yet to see the proper page). I am using VisualStudio-2008, 64 bit. Can anybody point me the correct direction?
Upvotes: 1
Views: 7376
Reputation: 5274
I included one file from code project, in that it uses some ASSERT,AfxisValidString. They included afx.h, for that. It is also the header for CTime. So, when I removed, and added atltime.h, then the ASSERT related things threw the errors. Sorry, I wated some of your precious time. I am going to vote to delete this question.
Upvotes: 0
Reputation: 6983
Can you show us your errors?
this code works just fine on a 32 bit computer with a win32 project with atl.
#include "stdafx.h"
#include <atltime.h>
int _tmain(int argc, _TCHAR* argv[])
{
CTime ct;
printf("day of week %d\n",ct.GetDayOfWeek());
return 0;
}
Upvotes: 1
Reputation: 36102
Sounds like you are having a conflict with the MFC and ATL version of CTime. Since you specify MFC in your tag I suspect that you want the MFC verion. The atltime.h is for ATL projects. Afx.h has CTime for MFC which AFAIK is normally always included in the stdafx.h
Upvotes: 1
Reputation: 34625
You need to have #include <time.h>
. Check the requirements part of the link. MSDN CTime
Upvotes: 0