d下有个文件夹1,执行
    HANDLE hFind = ::FindFirstFile("d:\\*.*",&fd);
::SetCurrentDirectory("1");
::SetCurrentDirectory("1");不必指定路径,fd就能指向d:\1了?

解决方案 »

  1.   

    SetCurrentDirectoryThe SetCurrentDirectory function changes the current directory for the current process.
    BOOL SetCurrentDirectory(
      LPCTSTR lpPathName
    );Parameters
    lpPathName 
    [in] Pointer to a null-terminated string that specifies the path to the new current directory. This parameter may be a relative path or a full path. In either case, the full path of the specified directory is calculated and stored as the current directory. 
    The string must not exceed MAX_PATH characters, including the terminating null character. The final character before the null character must be a backslash ('\'). If you do not specify the backslash, it will be added for you. Therefore you can specify MAX_PATH-2 characters for the path, or MAX_PATH-1 characters for the path if you include the trailing backslash