CString getTimefromSec(int sec)
{
int second = sec;
int hour, minute;
hour = second / 3600;
second = second - hour * 3600;
minute = second / 60;
second = second -minute * 60;
CString strhour, strmin, strsec;
if (hour < 10)
strhour.Format(TEXT("0%d"), hour);
else
strhour.Format(TEXT("%d"), hour);
if (minute < 10)
strmin.Format(TEXT("0%d"), minute);
else
strmin.Format(TEXT("%d"), minute);
if (second < 10)
strsec.Format(TEXT("0%d"), second);
else
strsec.Format(TEXT("%d"), second);
CString strDuration;
strDuration = strhour + TEXT(":") + strmin + TEXT(":") + strsec;
return strDuration;
}