Partager via


ICcObjectContainer::AddObject (Windows Embedded CE 6.0)

1/5/2010

This method adds a new Core Connectivity object to the current container.

In Windows Embedded CE 6.0, CoreCon HLAPI has been deprecated.

Syntax

HRESULT AddObject(
  BSTR in_bstrName,
  BSTR in_bstrID,
  ICcObject** out_ppiObject
);

Parameters

  • in_bstrName
    [in] Name of the object.
  • in_bstrID
    [in] ID of the object.
  • out_ppiObject
    [out, retval] Pointer to the newly created object.

Return Value

Value Description

S_OK

A new object is created through the out parameter.

E_INVALIDARG

Invalid arguments.

The strings must be non-NULL.

The out parameter must be non-NULL.

E_DUPLICATE

An object with the same ID exists in the container.

E_FAIL

The return value for any other failure.

E_OUTOFMEMORY

The method could not allocate the bstr parameterin_bstrID, or in_bstrName.

E_DATASTORE_XMLTEXT

An input parameter, not XML text.

E_DATASTORE_TYPEERROR

A datastore internal type error.

Remarks

You can use a query interface with out_ppiObject to find an appropriate Core Connectivity datastore interface.

For example, the ICcDeviceContainer interface can only add ICcDevice objects.

Requirements

Header ccdatastore.h
Windows Windows 2000, Windows Server 2003, Windows Server 2003 Service Pack 1, Windows XP Home, Windows XP Pro

See Also

Reference

ICcObjectContainer
Core Connectivity Interfaces