First of all, hello everyone again.
I am making a win32 MFC console program that is supposed to use a timer. (kind of like an alarm clock) The constructor in my CTimer class currently goes like this:
CTimer::CTimer(_int64 days, _int64 hours, _int64 minutes, _int64 seconds)
{
seconds = seconds * 1000;
minutes = minutes * 60000;
hours = hours * 3600000;
days = days * 86400000;
designatedTime = days + hours + minutes + seconds;
DWORD designatedPeriod;
cout << "\n\nPlease enter this number: " << designatedTime << ": ";
cin >> designatedPeriod;
cout << "\nSleeping for the designated amount of time...";
::Sleep(designatedPeriod);
::Beep(2000,20000);
}
My goal is to be able to get rid of the ridiculous part where the user has to enter the milliseconds in, after all, what is the efficiency of that? In summary, if there is a way to convert a _int64 to a DWORD, how; and if not what would be a better way of going about this.
-Bones
I am making a win32 MFC console program that is supposed to use a timer. (kind of like an alarm clock) The constructor in my CTimer class currently goes like this:
CTimer::CTimer(_int64 days, _int64 hours, _int64 minutes, _int64 seconds)
{
seconds = seconds * 1000;
minutes = minutes * 60000;
hours = hours * 3600000;
days = days * 86400000;
designatedTime = days + hours + minutes + seconds;
DWORD designatedPeriod;
cout << "\n\nPlease enter this number: " << designatedTime << ": ";
cin >> designatedPeriod;
cout << "\nSleeping for the designated amount of time...";
::Sleep(designatedPeriod);
::Beep(2000,20000);
}
My goal is to be able to get rid of the ridiculous part where the user has to enter the milliseconds in, after all, what is the efficiency of that? In summary, if there is a way to convert a _int64 to a DWORD, how; and if not what would be a better way of going about this.
-Bones