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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CTime problem

Status
Not open for further replies.

atoledo

Programmer
Oct 14, 2002
16
ES
int checkingDate(string number,int dateDigit)
{

//int currentDigit=0;
int good;
int digitToCheck;
long difDays;
int newYear=0;
string stringYear;
int modCurrentDigit;
string tempDigit;
tempDigit.insert(0,number[dateDigit]);
digitToCheck=atoi(tempDigit.c_str());

//currentDigit=currentDat1.GetYear();
modCurrentDigit=currentDigit%10;

if (modCurrentDigit<digitToCheck){
newYear=currentDigit-modCurrentDigit;
newYear=newYear-10;
newYear=newYear+digitToCheck;

}
else{
newYear=currentDigit-modCurrentDigit+digitToCheck;
}
CTime newDate(newYear,12,31,0,0,0,0);

if(currentDat1<newDate)
good=1;
else
if(isLeapYear(currentDigit)){
difDays=(currentDat1-newDate).GetDays();
if (difDays<=59)
good=1;
else
good=0;
}
else{
difDays=(currentDat1-newDate).GetDays();
if (difDays<=60)
good=1;
else
good=0;
}
return good;
}

Can sombedoy tell me whats the problem with this code.... when I execute it it gives me an Acces Violation when it tries to create the CTime objetc....

Thanks in advance!!!!
 
When I debug my application it gives me the Access Violation when it tries to run the mktime function :S

PLEASE HELP!!!! I have two days triying to manage this !!!

Thanks
 
You posted a lot of code, but mktime() is not shown ..... pretty difficult to help.

/JOlesen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top