Share via


CFtpConnection::GetCurrentDirectory

Call this member function to get the name of the current directory.

BOOL GetCurrentDirectory( 
   CString& strDirName  
) const; 
BOOL GetCurrentDirectory( 
   LPTSTR pstrDirName, 
   LPDWORD lpdwLen  
) const;

Parameters

  • strDirName
    A reference to a string that will receive the name of the directory.

  • pstrDirName
    A pointer to a string that will receive the name of the directory.

  • lpdwLen
    A pointer to a DWORD that contains the following information:

    On entry

    The size of the buffer referenced by pstrDirName.

    On return

    The number of characters stored to pstrDirName. If the member function fails and ERROR_INSUFFICIENT_BUFFER is returned, then lpdwLen contains the number of bytes that the application must allocate in order to receive the string.

Return Value

Nonzero if successful; otherwise 0. If the call fails, the Win32 function GetLastError may be called to determine the cause of the error.

Remarks

To get the directory name as a URL instead, call GetCurrentDirectoryAsURL.

The parameters pstrDirName or strDirName can be either partially qualified filenames relative to the current directory or fully qualified. A backslash (\) or forward slash (/) can be used as the directory separator for either name. GetCurrentDirectory translates the directory name separators to the appropriate characters before they are used.

Requirements

Header: afxinet.h

See Also

Reference

CFtpConnection Class

Hierarchy Chart

CFtpConnection::GetCurrentDirectoryAsURL

CInternetConnection Class