Click to return to the Web Content Management home page    
IWPProvider Interface     IWPSiteW Interface     IWPProvider Interface    
Web Workshop  |  Web Content Management

IWPProvider::SetProgressUpdateProc Method


Specifies the callback function the provider should use to update the "Publishing files" progress dialog box displayed by the API.

Syntax

HRESULT SetProgressUpdateProc(
    LONG *pfnProgressUpdateProc 
); 

Parameters

pfnProgressUpdateProc
Function with the following declaration:
HRESULT CALLBACK *pfnProgressUpdateProc(
    LPCWSTR wsFileName,
    DWORD dwNumBytes
);

The type PFNPROGRESSUPDATEPROC declared in Wpspi.idl encapsulates this declaration.

Return Value

Returns S_OK if successful, or an error code otherwise.

Remarks

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 box as it posts and commits the files passed to it. PostFiles 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.

Example

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 box without advancing the progress bar, it should make a call such as the following:

hResult = (*m_pfnProgressUpdateProc)(wsFileName, 0);


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.