Contents Index Topic Contents | ||
Previous Topic: SetParam Next Topic: The File Upload Control Interface |
SetProgressUpdateProc
HRESULT SetProgressUpdateProc( [in] LONG * pfnProgressUpdateProc );Specifies the callback function the provider should use to update the "Publishing Files" progress dialog displayed by the API.
- pfnProgressUpdateProc
- Function with the following declaration:
HRESULT CALLBACK *pfnProgressUpdateProc( [in, string] LPCWSTR wsFileName [in] DWORD dwNumBytes );The type PFNPROGRESSUPDATEPROC declared in WPSPI.IDL encapsulates this declaration.
The service provider should cache the function pointer specified here so that it can call into the update procedure from PostFiles and Commit. (The progress bar is reset after all the PostFiles calls have been made, and fills a second time during the call to Commit.)
The Service Provider should call this function from both PostFiles and Commit to update the progress dialog as it posts and commits the files passed to it. WpPost will do a series of PostFiles calls, followed by a single call to Commit. The API keeps track of the total number of bytes being transferred, so on each call the service provider should just specify the file name to display and the number of bytes that have been posted or committed since the last call.
If the update procedure returns an error, the Service Provider must quit its current operation and return the error (as the result code from PostFiles or Commit.) This ensures that if the "Cancel" button is clicked by the user during publishing, it will be processed correctly.
A typical call to the callback procedure is as follows:
hResult = (*m_pfnProgressUpdateProc)(wsFileName, dwFileSize);If the service provider wishes to change the file name displayed in the progress dialog without advancing the progress bar, it should make a call such as the following:
hResult = (*m_pfnProgressUpdateProc)(wsFileName, 0);
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.