다음을 통해 공유


SpCreateBestObject (Windows CE 5.0)

Send Feedback

This function creates an object from tokens that best match a set of attributes.

HRESULT SpCreateBestObject(constWCHAR* pszCategoryId,constWCHAR* pszReqAttribs,constWCHAR* pszOptAttribs,T** ppObject,IUnknown* pUnkOuter=NULL,DWORDdwClsCtxt=CLSCTX_ALL,);

Parameters

  • pszCategoryId
    [in] Pointer to the category identifier on which to base the new token.
  • pszReqAttribs
    [in] Pointer to required attributes for the token.
  • pszOptAttribs
    [in] Pointer to optional attributes for the token.
  • ppObject
    [out, iid_is(riid)] Address of a pointer to the interface indicated by riid, or NULL if the interface is not supported.
  • pUnkOuter
    [in] Optional pointer to IUnknown, used for creating aggregate objects. pUnkOuter is the data for the object. If not specified, the value defaults to NULL.
  • dwClsCtxt
    [in] Context in which the code that manages the newly created object will run. The following list shows the possible values. If a value is not specified, the parameter defaults to CLSCTX_ALL.
    • CLSCTX_ALL
    • CLSCTX_INPROC_SERVER
    • CLSCTX_INPROC_HANDLER
    • CLSCTX_LOCAL_SERVER
    • CLSCTX_REMOTE_SERVER

Return Values

The following table shows the possible return values.

Value Description
S_OK Function completed successfully.
FAILED(hr) Appropriate error message.

Requirements

OS Versions: Windows CE .NET 4.1 and later.
Header: Sphelper.h.
Link Library: Sapilib.lib.

See Also

SAPI Functions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.