ICcObjectContainer::AddObject (Windows CE 5.0)
This method adds a new Core Connectivity object to the current container.
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 Values
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 parameter in_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
OS Version: Windows 2000, Windows XP Home, Windows XP Pro, Windows Server 2003, and Windows Server 2003 Service Pack 1.
Header: CcDatastore.h.
Link Library: none.
See Also
Send Feedback on this topic to the authors