CanExecute method

Determines whether the Accelerator can be executed.


HRESULT retVal = object.CanExecute(pInput, pOutput, pfCanExecute);


  • pInput [in]
    Type: [IOpenServiceActivityInput](cc849074(v=vs.85).md)

    An IOpenServiceActivityInput interface that provides access to the input context and variables.

  • pOutput [in]
    Type: [IOpenServiceActivityOutputContext](cc849069(v=vs.85).md)

    An IOpenServiceActivityOutputContext interface that accepts output from the Accelerator.

  • pfCanExecute [out]
    Type: BOOL

    TRUE if the Accelerator can be executed; otherwise, FALSE.

Return value


If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


This method should be called before the IOpenServiceActivity::Execute method is called.

The interface referenced by the pOutput parameter can determine if navigation is allowed, through a call to the IOpenServiceActivityOutputContext::CanNavigate method of that interface.