Platform SDK: Transaction Server

ISharedPropertyGroup.CreatePropertyByPosition Method

[This product will work only on Windows NT 4.0 versions and earlier. For Windows 2000 and later, see COM+ (Component Services).]

Creates a new shared property identified by a numeric index that's unique within the property group. If a shared property with the specified index already exists, CreatePropertyByPosition returns a reference to the existing one.

Provided By

ISharedPropertyGroup Interface

ISharedProperty CreatePropertyByPosition (
    int index,
    boolean[] exists;
);

Parameters

index
[in] The numeric index within the SharedPropertyGroup by which the new property will be referenced. You can use this index later to retrieve the shared property with the getPropertyByPosition method.

exists
[out] An array of one boolean value. If exists is set to true on return from this method, the shared property specified by index existed prior to this call. If it's set to false, the property was created by this call.

Return Value

A reference to a shared property object that's identified by the numeric index passed in the index 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 SharedProperty object with the CreatePropertyByPosition method, you can access that property only by using the getPropertyByPosition method. You can't assign a string name to the same property and then access it by using the getProperty method. Accessing a property by position is faster than accessing a property by using a string name because it requires less overhead.

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

Example

See Also

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