Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Clock using C++ & DirectX

I'm trying to do a clock using the DirectX & C++.
So I wrote quite everything but now I have a BIG problem, I have to use the system time and apply the hour to the hour hand on the clock and the same for the minute hand.
I have created a function called SetValue(int valueH, int valueM) that calculates and sets the position on the clock of the hands, but I don't know how can I get the system time.
Here my control (part of a code):

static int minute = 0;
static int hour = 1;
minute++;

if (minute > 59)
{
if (hour > 11)
hour = 0;
hour++;
minute = 0;
}

for (i = 0; i < Clock; i++)
ClockV.getElement(i)->SetValue(hour, minute);

By now che hands rotate, but not using the system time!

Please help me!! :( :(
[841 byte] By [Arkanops] at [2007-11-11 8:28:07]
# 1 Re: Clock using C++ & DirectX
Hi,

try
CTime timeNow = CTime::GetCurrentTime();
string nowStr = timeNow.Format("%Y-%m-%d_%H:%M:%S");
...

D
drkybelk at 2007-11-11 21:01:23 >
# 2 Re: Clock using C++ & DirectX
Not usable with DirectX
Arkanops at 2007-11-11 21:02:23 >
# 3 Re: Clock using C++ & DirectX
Problem fixed!!
Arkanops at 2007-11-11 21:03:21 >