Changing a File Time to the Current Time
The following example sets the last-write time for a file to the current system time using the SetFileTime function.// SetFileToCurrentTime - sets last write time to current system time
// Return value - TRUE if successful, FALSE otherwise
// hFile  - must be a valid file handleBOOL SetFileToCurrentTime(HANDLE hFile)
{
    FILETIME ft;
    SYSTEMTIME st;
    BOOL f;    GetSystemTime(&st);              // gets current time
    SystemTimeToFileTime(&st, &ft);  // converts to file time format
    f = SetFileTime(hf,              // sets last-write time for file
        (LPFILETIME) NULL, (LPFILETIME) NULL, &ft);    return f;
}

解决方案 »

  1.   

    SYSTEMTUNE tm;
    ::GetSystemTime(&tm);
      

  2.   

    为什么那样不对哪
    SYSTEMTIME* pTime;
    ::GetSystemTime(pTime);
      

  3.   

    在GetSystemTime(&tm);中,&tm是一个引用型的变量,而不是简单的指向结构的指针(或地址),关于引用型参数,你去看一下C++的书吧
      

  4.   

    GetSystemTime的参数是一个指向SYSTEMTIME结构的指针
    因此你必须首先申明一个SYSTEMTIME结构,然后用这个结构的地址作为参数传递给GetSystemTime。