Share via


IProductCatalog3::BeginSpecificationSearch Method [C++]

Use this method to initialize a specification search of a catalog.

Definition

[C++]

HRESULT IProductCatalog3::BeginSpecificationSearch(BSTRstrCategoryName,
  VARIANT*pRSInitialPropValuesList,
  VARIANT*plTotalRecordsAvailable,
  BSTR*pstrSearchHandle);

[Visual Basic]

Function BeginSpecificationSearch(strCategoryName As String,
  Optional pRSInitialPropValuesList As Variant,
  Optional plTotalRecordsAvailable As Variant) As String

Parameters

  • strCategoryName[C++]
    [in] A BSTR that contains the name of the category in which to search.
  • strCategoryName[Visual Basic]
    A String that contains the name of the category in which to search.
  • pRSInitialPropValuesList[C++]
    [out, optional] A pointer to a VARIANT used to return the recordset of initial property values.
  • pRSInitialPropValuesList[Visual Basic]
    A Variant used to return the recordset of initial property values.
  • plTotalRecordsAvailable[C++]
    [out, optional] A pointer to a VARIANT used to return the total records available.
  • plTotalRecordsAvailable[Visual Basic]
    A Variant used to return the total records available.
  • pstrSearchHandle[C++]
    [out, retval] A BSTR used to return the state of the specification search.

Return Values

[C++] This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic] If this method completes successfully, it returns a String that contains the state of this specification search.

Error Values

[C++] This method returns S_OK (0x00000000) to indicate success and either standard or custom COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

[Visual Basic] This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to either standard or custom COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

The following table shows the custom COM errors that this method can return.

Constant Value Description
E_POINTER

[C++] 0x80004003

[Visual Basic] &H80004003

The pointer is invalid.
E_INVALIDARG

[C++] 0x80070057

[Visual Basic] &H80070057

One or more arguments are invalid
E_CAT_INVALID_RETURN_PROPS

[C++] 0x8898011D

[Visual Basic] &H8898011D

The properties to return that you specified are invalid. Properties that contain a space should be enclosed in square brackets. Properties should not contain [ or ] and /* or -- in property names.
E_CAT_INVALID_CATEG_LENGTH

[C++] 0x88980047

[Visual Basic] &H88980047

The category name you specified is either blank or exceeds the maximum allowed length of 128 characters or cannot be converted to a string.
E_CAT_VC_INVALID_PROD_ID_OR_CATEGORY_NAME

[C++] 0x889800FB

[Visual Basic] &H889800FB

The value you specified for the ProductID or CategoryName exceeds the maximum allowed length of 348 characters.
E_CAT_CATEGORY_NOT_EXISTS_NOT_SEARCHABLE

[C++] 0x88980049

[Visual Basic] &H88980049

The category you specified does not exists or is not marked as Specification searchable.

[C++] Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.

[Visual Basic] Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

[C++] The pRSInitialPropValuesList and pstrSearchHandle parameters contain valid data only if the method was accessed successfully.

The optional parameter pRSInitialPropValuesList is a single row recordset. The returned recordset contains one field for each searchable property for the products under the specified category. Each field contains a SAFEARRAY. Each SAFEARRAY contains a set of all the distinct values found in all the products under that category. Only the properties that are marked as searchable are returned in the recordset.

If all the searchable properties contain NULL values then the pRSInitialPropValuesList parameter will be set to NULL and the plTotalRecordsAvailable parameter will be zero (0).

A category can be marked as searchable by setting the IsSearchable property to True.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

[Visual Basic]

Example

'
strSearchHandle = myProductCatalog.BeginSpecificationSearch(strCategoryName, pRSInitialPropValuesList)

See Also

[C++]ProductCatalog Object

[Visual Basic]ProductCatalog Object

[C++]IProductCatalog3::AddSpecificationSearchClause

[Visual Basic]ProductCatalog.AddSpecificationSearchClause

[C++]IProductCatalog3::GetSpecificationSearchClauses

[Visual Basic]ProductCatalog.GetSpecificationSearchClauses

[C++]IProductCatalog3::PerformSpecificationSearch

[Visual Basic]ProductCatalog.PerformSpecificationSearch

Copyright © 2005 Microsoft Corporation.
All rights reserved.