Compartilhar via


IOleComponentUIManager.OnUIEventProgress Method

Definition

Requests the display of a progress indicator during a long-term operation.

public:
 int OnUIEventProgress([Runtime::InteropServices::Out] System::UInt32 % pdwCookie, int fInProgress, System::String ^ pwszLabel, System::UInt32 nComplete, System::UInt32 nTotal);
int OnUIEventProgress([Runtime::InteropServices::Out] unsigned int & pdwCookie, int fInProgress, std::wstring const & pwszLabel, unsigned int nComplete, unsigned int nTotal);
public int OnUIEventProgress (out uint pdwCookie, int fInProgress, string pwszLabel, uint nComplete, uint nTotal);
abstract member OnUIEventProgress : uint32 * int * string * uint32 * uint32 -> int
Public Function OnUIEventProgress (ByRef pdwCookie As UInteger, fInProgress As Integer, pwszLabel As String, nComplete As UInteger, nTotal As UInteger) As Integer

Parameters

pdwCookie
UInt32

[in] Identifies a progress indicator. Setting pdwCookie to zero indicates that the SOleComponentUIManager service should start a new progress indicator. If pdwCookie is not set to zero, the service should display the current progress indicator.

fInProgress
Int32

[in] Set to true to start or continue display of a progress indicator and false to cancel the progress display.

pwszLabel
String

[in] Points to the label that explains the purpose of the progress indicator. If pswzLabel is set to null on subsequent calls to update the progress of an on-going progress indicator, the previous value of the label is used.

nComplete
UInt32

[in] Specifies the time that has already passed for the operation.

nTotal
UInt32

[in] Specifies the total duration of the operation.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From oleipc.idl:

HRESULT IOleComponentUIManager::OnUIEventProgress(  
   [in][out] DWORD_PTR *pdwCookie,  
   [in] BOOL fInProgress,  
   [in] LPOLESTR pwszLabel,  
   [in] ULONG nComplete,  
   [in] ULONG nTotal  
);  

To start a new progress indicator, a VSPackage object calls OnUIEventProgress, setting pdwCookie to null and fInProgress to TRUE. The SOleComponentUIManager service returns a value to identify the particular progress indicator. The VSPackage object must use this value on all subsequent calls to update the progress indicator state. The VSPackage object calls OnUIEventProgress with fInProgress set to false to discontinue the progress indicator.

The SOleComponentUIManager service controls whether or not multiple progress indicators can be running simultaneously. Typically pdwCookie is set to 1 to indicate that only one progress indicator at a time is allowed.

Applies to