War diese Seite hilfreich?
Ihr Feedback ist uns wichtig. Teilen Sie uns Ihre Meinung mit.
Weiteres Feedback?
1500 verbleibende Zeichen
MSDN Library
EN
Dieser Inhalt ist in Ihrer Sprache leider nicht verfügbar. Im Folgenden finden Sie die englische Version.

IBackgroundCopyJob::EnumFiles method

Retrieves an IEnumBackgroundCopyFiles interface pointer that you use to enumerate the files in a job.

Syntax


HRESULT EnumFiles(
  [out] IEnumBackgroundCopyFiles **ppEnumFiles
);

Parameters

ppEnumFiles [out]

IEnumBackgroundCopyFiles interface pointer that you use to enumerate the files in the job. Release ppEnumFiles when done.

Return value

This method returns S_OK on success or one of the standard COM HRESULT values on error.

Examples

The enumerator object is a snapshot of the files in the job at the time you call the EnumFiles method. If you retrieve property values from a file in the enumerator, however, the values reflect the current property values of the file.

The following example shows how to enumerate the files in a job. The example assumes the IBackgroundCopyJob interface pointer is valid.


HRESULT hr;
IBackgroundCopyJob* pJob;
IEnumBackgroundCopyFiles* pFiles = NULL;
IBackgroundCopyFile* pFile = NULL;
WCHAR* pLocalFileName = NULL;
ULONG cFileCount = 0;
ULONG idx = 0;

hr = pJob->EnumFiles(&pFiles);
if (SUCCEEDED(hr))
{
  //Get the count of files in the job. 
  pFiles->GetCount(&cFileCount);

  //Enumerate the files in the job.
  for (idx=0; idx<cFileCount; idx++)
  {
    hr = pFiles->Next(1, &pFile, NULL);
    if (S_OK == hr)
    {
      //Get the local name of the file.
      hr = pFile->GetLocalName(&pLocalFileName);
      if (SUCCEEDED(hr))
      {
        //Do something with the file information.
        CoTaskMemFree(pLocalFileName); 
      }

      pFile->Release();
      pFile = NULL;
    }
    else
    {
      //Handle error
      break;
    }
  }

  pFiles->Release();
  pFiles = NULL;
}

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

Bits.h

IDL

Bits.idl

Library

Bits.lib

DLL

QmgrPrxy.dll

IID

IID_IBackgroundCopyJob is defined as 37668D37-507E-4160-9316-26306D150B12

See also

IEnumBackgroundCopyFiles
IBackgroundCopyManager::EnumJobs

 

 

Community-Beiträge

HINZUFÜGEN
Anzeigen:
© 2015 Microsoft