GetName


The GetName method retrieves name of the file attached to the object.
C++
long GetName(
  LPSTR Path,                        // buffer that receives absolute path
  long PathLength                    // size of buffer
);
long GetName(
  LPWSTR Path,                       // buffer that receives absolute path
  long PathLength                    // size of buffer
);
BASIC
GetName() As String

Parameters

C++
Path
Pointer to buffer that receives path.
Buffer must be large enough to accept at most PathLength + 1 characters.
PathLength
Size of buffer; if file name is longer than PathLength, error is returned.

Return Values

C++
If the method succeeds, the return value is the number of characters returned to the user, not including terminating NULL.
If the method fails, the return value is failure code and error code is set. Call GetError to get error code.
BASIC
If the method succeeds, the return value is a String containing name of the file.
If the method fails, the return value is NULL and failure code and error code are set.

Remarks

If file was opened with Open or OpenAdvanced method, name of the file returned by the method is always fully qualified - relative path is expanded to the full (absolute) path. If file was attached to the object with Attach method, its name is stored exactly as specified by user; it is not checked nor processed at all.

Unicode version of the method should not be confused with Unicode system calls - all versions of the method can be used on Unicode and non-Unicode systems depending on your needs. See Unicode Support for more information on Unicode system calls, Unicode methods and Unicode text data.

See Also

Open, OpenAdvanced, Attach, GetFile, Opening File and Attaching