CFtpQueue::GetNextFile Method  
 
DWORD GetNextFile(
  LPFTPQUEUEDFILE lpFileInfo  
);

The GetNextFile method returns information about the next file in the transfer queue.

Parameters

lpFileInfo
A pointer to a FTPQUEUEDFILE structure which will contain information about the file. This parameter cannot be NULL.

Return Value

If the method succeeds, the return value is an unsigned integer with a non-zero value which uniquely identifies the file in the queue. If there are no additional queued files which match the exclusion criteria specified with the call to GetFirstFile, the return value is zero. To get extended error information, call GetLastError.

Remarks

This method returns information about the next file in the current transfer queue after an initial call to GetFirstFile. To obtain a list of all matching files in the queue, call this method repeatedly until it returns a value of zero. When information about the last file in the queue has been returned, the last error code will be set to ST_ERROR_END_OF_QUEUE.

Example

// List all files in a file transfer queue
FTPQUEUEDFILE queuedFile;
DWORD dwFileId;

dwFileId = pQueue->GetFirstFile(FTP_QUEUE_ALL, FTP_QUEUE_FLAG_NONE, &queuedFile);

while (dwFileId != 0)
{
    switch (queuedFile.dwQueueMode)
    {
    case FTP_QUEUE_DOWNLOAD:
        _tprintf(_T("%u: download \"%s\" to \"%s\"\n"),
                 queuedFile.dwFileId,
                 queuedFile.szRemoteFile,
                 queuedFile.szLocalFile);
        break;

    case FTP_QUEUE_UPLOAD:
        _tprintf(_T("%u: upload \"%s\" to \"%s\"\n"),
                 queuedFile.dwFileId,
                 queuedFile.szRemoteFile,
                 queuedFile.szLocalFile);
        break;
    }

    dwFileId = pQueue->GetNextFile(&queuedFile);
}

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: csftpv12.lib
Unicode: Implemented as Unicode and ANSI versions

See Also