<div class="content" name="Add" uuid="1a7ac278-27d8-4e44-b529-fe8dd244400d"><p>The Add method adds an item to the underlying collection of
the enumerator; if the item is already present in the collection, it is
replaced by the one being passed to this method.</p><dl>
<dd>
<div><pre> [id(3), helpstring(&#34;Add an item to the collection&#34;)] HRESULT Add(
   [in] VARIANT* item,
   [in] BSTR objectID
 );
</pre></div>
</dd></dl><p><b>item: </b>If the underlying collection is of
application-specific <span><a href="e74594a9-404c-4729-91f4-3fe4453cdf4d#gt_a13ede6f-987d-4fb2-890f-fc1a0c5b2367" data-linktype="relative-path">publisher/subscriber</a></span>
<span><a href="e74594a9-404c-4729-91f4-3fe4453cdf4d#gt_f362c255-5746-44db-aa04-e8060543a19c" data-linktype="relative-path">subscription</a></span>
properties, this MUST conform to the application-specific property values as
specified in section <span><a href="424e0b76-d9e5-4c2e-9bcd-1bc2cdf45cdd" data-linktype="relative-path">2.2.2.2</a></span>. If the
underlying collection is of <span><a href="66217d57-8c60-4423-9b24-52923f4c2afa" data-linktype="relative-path">event classes</a></span>, the
type of the VARIANT MUST be VT_UNKNOWN and MUST contain a DCOM <span><a href="e74594a9-404c-4729-91f4-3fe4453cdf4d#gt_8bb43a65-7a8c-4585-a7ed-23044772f8ca" data-linktype="relative-path">object</a></span>
supporting the <span><a href="2510bb77-b0ab-4254-b3b8-dd5c6189eef2" data-linktype="relative-path">IEventClass2</a></span>
interface. If the underlying collection is of <span><a href="0d617a76-fc58-455c-9e30-1a8436c5f73a" data-linktype="relative-path">subscriptions</a></span>, the
type of the VARIANT MUST be VT_UNKNOWN and MUST contain a DCOM object
supporting the <span><a href="542e1c26-d18a-4686-a47e-8be9ca73e352" data-linktype="relative-path">IEventSubscription</a></span>
interface.</p><p><b>objectID: </b>The identity of the object. If the
underlying collection is of the application-specific publisher/subscriber
subscription properties, this MUST conform to the application-specific property
names as specified in <span><a href="6e22df28-0d31-46f1-baab-5b37f15c3b33" data-linktype="relative-path">2.2.2.1</a></span>. If the
underlying collection is of event classes, this MUST conform to the
EventClassID property of the event class as specified in section 3.1.1.1. If
the underlying collection is of subscriptions, this MUST conform to the
SubscriptionID property of the subscription as specified in section 3.1.1.2.</p><p><b>Return Values: </b>An <span><a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path">HRESULT</a></span>
specifying success or failure. All success codes MUST be treated the same, and
all failure codes MUST be treated the same.</p><p>When this method is invoked, the <span><a href="e74594a9-404c-4729-91f4-3fe4453cdf4d#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a></span> MUST validate
the <i>item</i> and the <i>objectID</i> parameters. If the validation fails,
the server MUST fail the call, returning a failure HRESULT back to the client.
Otherwise, the server MUST attempt to add this item to the collection of the
enumerator DCOM object servicing this call, and fail the call if it cannot. If
the object in the collection already has the <i>objectID</i> specified in the
call, the server MUST fail the call.</p></div>