Home > Software engineering >  In XP system folder copy for less than path, please advise
In XP system folder copy for less than path, please advise

Time:10-11

Cstrings path=_T (".. \ \ SMS \ \ *. * "); \ \ the SMS as the folder name
BOOL IS=finder. FindFile (path); \ \ to find the source file if there is a Windows 7 and doing here are likely to find the path in the system, but in the XP system can not
While (IS)
{
IS=FindNextFile ();
If (folder)
{
Recursive function called;
}
The else (file)
{
Direct copy;
}
}

CodePudding user response:

SetCurrentDirectory
The SetCurrentDirectory function changes The current directory for The current process.

BOOL SetCurrentDirectory (
LPCTSTR lpPathName//pointer to the name of the new current directory
);

The Parameters
LpPathName
Pointer to a null - terminated string that specifies the path to the new current directory. This parameter may be a relative path or a fully qualified path. In either case, the fully qualified path of the specified directory is calculated and stored as the current directory.
The Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Few
Each process has a single current directory made up of two parts:

A disk designator that is either A drive letter followed by A colon, or A server name and the share name (\ \ servername \ sharename)
A directory on the disk designator
QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winbase. H.
The Import Library: Use kernel32. Lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also
The File I/O the Overview, the File Functions provides, GetCurrentDirectory


GetCurrentDirectory
The GetCurrentDirectory function retrieves The current directory for The current process.

DWORD GetCurrentDirectory (
DWORD nBufferLength,//the size, in characters, of the directory buffer
LPTSTR lpBuffer//pointer to the buffer for the current directory
);

The Parameters
NBufferLength
Specifies the length, in characters, of the buffer for the current directory string. The buffer length must include room for a terminating null character.
LpBuffer
Pointer to the buffer for the current directory string. This null - terminated string specifies the absolute path to the current directory.
The Return Values
If the function succeeds, the return value specifies the number of characters written to the buffer, not o the terminating null character.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

If the buffer pointed to by lpBuffer is not large enough, the return value specifies the required size of the buffer, o the number of bytes necessary for a terminating null character.

QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winbase. H.
The Import Library: Use kernel32. Lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also
The File I/O the Overview, the File Functions provides, CreateDirectory, GetSystemDirectory, GetWindowsDirectory, RemoveDirectory, SetCurrentDirectory


CodePudding user response:

Zhao four teachers have more explicit solution?? Look not to understand the

CodePudding user response:

Zhao old wet said to set up a current path
Or do you all use absolute paths,

CodePudding user response:

Thank you jennyvenus
BOOL IS=finder. FindFile (path absolute path); Is available but directly using the absolute path flexibility greatly reduces the project
I read from the XML file is relative path now read the solution is to want to take out the relative path into an absolute path,
How will be based on using c + + under vs2010MFC relative path into an absolute path??????? Also, please advise,,, thank you very much
  • Related