Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method creates a new object in the specified container. The id attribute is set by the ContentDirectory service, the restricted attribute is set to FALSE, and the elements of the new object are set using the specified data and, possibly, additional ContentDirectory service processing.

Syntax

virtual DWORD CreateObject(
  LPCWSTR 
pszContainerID,
  LPCWSTR 
pszElements,
  wstring* 
pstrObjectID,
  wstring* 
pstrResult
) = 0;

Parameters

pszContainerID

[in] ID of the container object in which to create the new object. Corresponds to the A_ARG_TYPE_ObjectID state variable.

pszElements

[in] DIDL-Lite XML fragment that specifies the new object's metadata. Corresponds to the A_ARG_TYPE_Result state variable.

pstrObjectID

[in, out] Pointer to a string that contains the object ID of the newly created object. Corresponds to the A_ARG_TYPE_ObjectID state variable.

pstrResult

[in, out] Pointer to a string that contains DIDL-Lite XML that represents the new object. Corresponds to the A_ARG_TYPE_Result state variable.

Return Value

Custom implementations can return appropriate error codes. Should return SUCCESS_AV if the method succeeds. Otherwise, should return an error code defined in WinError.h or UPnP.h, or one of the UPnP AV-specific return values specified in UPnPAVError, especially the following errors documented for this action in the ContentDirectory DCP documentation:

  • ERROR_AV_UPNP_ACTION_FAILED

  • ERROR_AV_UPNP_CD_NO_SUCH_CONTAINER

  • ERROR_AV_UPNP_CD_BAD_METADATA

  • ERROR_AV_UPNP_CD_RESTRICTED_PARENT_OBJECT

Remarks

This method corresponds to the ContentDirectory service's CreateObject action.

To create references to ContentDirectory items, see IContentDirectory::CreateReference.

The ContentDirectory service does not require that this method be implemented. Therefore, the IContentDirectoryImplclass overrides this method to return ERROR_AV_UPNP_INVALID_ACTION.

For more information about the actions in the ContentDirectory service, see UPnP AV DCP Documentation.

Requirements

Header av_upnp.h
Library Av_upnp.lib
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also