Partager via


IMAPIFolder::GetSearchCriteria (Compact 7)

3/12/2014

This method gets the search criteria for a folder.

Syntax

HRESULT GetSearchCriteria(
        ULONG ulFlags,
        LPSRestriction FAR * lppRestriction,
        LPENTRYLIST FAR * lppContainerList,
        ULONG FAR * lpulSearchState
); 

Parameters

  • ulFlags
    [in] Set of flags that control the type input string. The following flag must be set:

    MAPI_UNICODE

    Specifies that the input strings are in Unicode format.

  • lppRestriction
    [in, out] Pointer to an SRestriction structure that defines the search criteria. Callers must set this parameter to NULL.
  • lppContainerList
    [in, out] Pointer to a source folder list or other container. Callers must set this parameter to NULL.
  • lpulSearchState
    [out] Ignored.

Return Values

The following table shows the possible return values.

Value Definition

S_OK

The method succeeded.

MAPI_E_NOT_INITIALIZED

The search criteria were never established for the container.

MAPI_E_INVALID_PARAMETER

MAPI_UNICODE was not passed in the ulFlags parameter.

E_FAIL

The method failed due to an unspecified error.

E_INVALIDARG

The method failed because one or more of the arguments is not valid.

E_OUTOFMEMORY

The method failed because it needs more memory resources.

E_UNEXPECTED

The method failed due to an unexpected error.

Remarks

This method gets the search criteria for a container that supports searches such as a search results folder. The search criteria are created by calling IMAPIFolder::SetSearchCriteria for a container.

Note

When you no longer need the SRestriction data structure in the lppRestriction parameter, call MAPIFreeBuffer to release the memory.

See Also

Reference

IMAPIFolder
IMAPIFolder::CreateFolder