【发布时间】:2011-12-14 05:31:08
【问题描述】:
我发现<time.h> 中有 ctime 和 _ctime_32,但 ctime 也不是 CTime。是否有 CTime 32 位模拟?或者可能是类似 32 位 CTime 和 __time32_t 的东西。我在使用 64 位版本时遇到了兼容性问题。
好吧,也许我根本不需要 CTime,我正在接收 __time32_t 并使用它来提供变体时间:
SYSTEMTIME st;
CTime tmp = pCurPar[pot->numSubsection].SysTime;
tmp.GetAsSystemTime( st );
SystemTimeToVariantTime(&st,&pot->Value.date);
但我认为
CTime tmp = pCurPar[pot->numSubsection].SysTime;
转换不正确,因为我的 .SysTime 是 __time32_t 而 CTime 使用的是 64 位版本。
即使我遇到了一种情况,我需要将其作为 time32_t 提供,但使用 pot->Value.intVal = DayRec[pot->numSubsection].startTime.GetTime(); 我收到了警告 Warning 3 warning C4244: '=' : conversion from '__time64_t' to 'INT', possible loss of data
【问题讨论】:
-
你的“烦恼”究竟是什么?