Share via


SpCreateDefaultObjectFromCategoryId (Windows Embedded CE 6.0)

1/6/2010

This function creates a default object from a category identifier.

Syntax

HRESULT SpCreateDefaultObjectFromCategoryId(
  const WCHAR* pszCategoryId,
  T** ppObject,
  IUnknown* pUnkOuter = NULL,
  DWORD dwClsCtxt = CLSCTX_ALL
);

Parameters

  • pszCategoryId
    [in] Pointer to the category identifier on which to base the new object.
  • ppObject
    [out] Address of a pointer to the object being created.
  • 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 Value

The following table shows the possible return values.

Value Description

S_OK

Function completed successfully.

FAILED(hr)

Appropriate error message.

Example

CComPtr cpAudio;
hr = SpCreateDefaultObjectFromCategoryId(SPCAT_AUDIOIN, &cpAudio);

Requirements

Header sphelper.h
Library sapilib.lib
Windows Embedded CE Windows CE .NET 4.1 and later

See Also

Reference

SAPI Functions