ISharedPropertyGroup.CreateProperty Method

Creates and returns a reference to a new SharedProperty with a specified name. If a shared property by that name already exists, CreateProperty returns a reference to the existing property.

Provided By

ISharedPropertyGroup Interface

ISharedProperty CreateProperty (

String name,

boolean[] exists;

);

Parameters

name
[in] The name of the property to create. You can use this name later to obtain a reference to this property by using the getProperty method.

exists
[out] An array of one Boolean value that's set to true on return from this method if the shared property specified in the name parameter existed prior to this call, and false if the property was created by this call.

Return Value

A reference to a shared property object with the name specified in the name parameter, or null if an error is encountered.

Remarks

When you create a shared property, its value is set to the default, which is a Variant with an integer value of 0.

If you create a shared property with the CreateProperty method, you can access that property only by using the getProperty method. You can't assign a numeric index to the same property and then access it by using the getPropertyByPosition method.

The same shared property group can contain some shared property objects that are identified by name and others that are identified by position.

Example

See Also

Sharing State, ISharedPropertyGroup::CreatePropertyByPosition Method, ISharedPropertyGroup::get_PropertyByPosition Method, ISharedPropertyGroup::get_Property Method


© 1997 Microsoft Corporation. All rights reserved.