Doomulation
?????????????????????????
- Thread Starter
- #21
Stop your lame jokes about the Wii.Well, I have no interest in the Wii - I lost interest in Nintendo's stuff long ago, there are just never enough games I want to play for their consoles, that's all there is to it.
But hopefully the rest of you enjoy waving your arms in the air and all that other weird stuff that you'll have to do to play with your Wii Wii.
And just because you haven't liked Nintendo in the past doesn't mean you shouldn't give it a chance now. I agree with Scott - you ARE pathetic. Sorry for saying that.
I know it shouldn't have to be done like that, but otherwise I have to add a tray icon, which I'm too lazy to do right now.ScottJC said:kill it via taskmanager? Can't you just use the applications terminate function to kill it Doom? Shouldn't stay on anyway. Date counting isn't hard doom, use CTime, let me elabourate: CTime is extremely accurate as its the number of seconds since 1970 or something like that but anyway lots of things use it.
And actually, if you do think about it, date counting IS hard. Especially the month concept. Let me show the code so that you better understand what's going on. And btw, since this is a Win32 App, MFC isn't allowed. Stupid MS.
Code:
UINT64 Today, Target, TimeLeft;
FILETIME FileTimeToday, FileTimeTarget;
SYSTEMTIME SystemTimeToday, SystemTimeTarget;
int nYears, nMonths = 0, nDays, nHours, nMinutes, nSeconds, nDaysThisMonth;
GetSystemTimeAsFileTime(&FileTimeToday);
FileTimeToLocalFileTime(&FileTimeToday, &FileTimeToday);
FileTimeToSystemTime(&FileTimeToday, &SystemTimeToday);
Today = FileTimeToday.dwLowDateTime + ((UINT64)FileTimeToday.dwHighDateTime << 32);
SystemTimeTarget.wDay = 17;
SystemTimeTarget.wDayOfWeek = 0;
SystemTimeTarget.wHour = 0;
SystemTimeTarget.wMilliseconds = 0;
SystemTimeTarget.wMinute = 0;
SystemTimeTarget.wMonth = 11;
SystemTimeTarget.wSecond = 0;
SystemTimeTarget.wYear = 2006;
SystemTimeToFileTime(&SystemTimeTarget, &FileTimeTarget);
//FileTimeToLocalFileTime(&FileTimeTarget, &FileTimeTarget);
Target = FileTimeTarget.dwLowDateTime + ((UINT64)FileTimeTarget.dwHighDateTime << 32);
TimeLeft = Target - Today;
nYears = (int)(TimeLeft / TimePerYear);
TimeLeft -= nYears * TimePerYear;
nDays = (int)(TimeLeft / TimePerDay);
TimeLeft -= nDays * TimePerDay;
nHours = (int)(TimeLeft / TimePerHour);
TimeLeft -= nHours * TimePerHour;
nMinutes = (int)(TimeLeft / TimePerMinute);
TimeLeft -= nMinutes * TimePerMinute;
nSeconds = (int)(TimeLeft / TimePerSecond);
while (SystemTimeToday.wMonth <= SystemTimeTarget.wMonth)
{
SystemTimeToday.wMonth++;
nDaysThisMonth = DaysForThisMonth(SystemTimeToday.wMonth, SystemTimeToday.wYear);
if (nDays - nDaysThisMonth < 0) continue;
nDays -= nDaysThisMonth;
nMonths++;
}
How do I indeed convert the number of seconds / minutes / hours / days / whatever to months? That's a good question.
And when counting dates you need to take into account the one extra day every 4 years, which causes bumps in the road, too.