Share via


Add

Applies To: Windows 8, Windows 8.1

Adds a profile to the collection.

HRESULT Add
  ([in] IProfile* pProfile,
  [in] VARIANT_BOOL fMerge)
;

Parameters

  • pProfile
    [in] A pointer to an IProfile object to be added to the collection.
  • fMerge
    [in] A Boolean value that indicates whether to merge the pProfile with one in the collection with the same name. If a mutable profile is in the collection and this parameter is set to TRUE, the profiles are merged. Otherwise, the method returns an error. If the collection does not have a profile with the same name, the method ignores this parameter and adds the profile to the collection.

Return Value

The following table describes possible return values.

Return Value Description

S_OK

The function successfully added the profile to the collection.

E_INVALIDARG

One or more arguments are invalid. Use IErrorInfo to obtain detailed error information.

E_WPRC_FAILED_TO_ADD_PROFILE

The library failed to add a profile to the collection. Use IErrorInfo to obtain detailed error information.

See Also

Reference

IProfileCollection