ISharedPropertyGroup interface

Description

Represents a group of properties that are shared by all ActiveX components in a EAServer package. Contains methods to create, access, and destroy shared properties.

Methods

Usage

Call the ISharedPropertyGroupManager methods to create a new ISharedPropertyGroup object or to obtain a reference to an existing property group.

Property groups can be shared only among components that are installed in the same EAServer package.

See also

ISharedProperty interface, ISharedPropertyGroupManager interface




ISharedPropertyGroup::CreateProperty

Description

Creates a new shared property by name.

Syntax

#include <jagctx.h>
#include <JagSharedProp.h>

HRESULT ISharedPropertyGroup::CreateProperty (
        BSTR propertyName,
        VARIANT_BOOL* pfAlreadyExisted;
        ISharedProperty ** ppProperty,
);

Parameters

propertyName

A string containing the name by which the property will be referred.

pfAlreadyExisted

The address of a VARIANT_BOOL variable. On output, set to VARIANT_TRUE if the property already existed or VARIANT_FALSE otherwise. pfAlreadyExisted can be NULL if you do not care whether the property existed previously.

ppProperty

On output, a reference to an ISharedProperty object for the property or NULL if an error occurred.

Returns

Return value

To indicate

S_OK

Success.

E_INVALIDARG

Either name or ppProperty was NULL.

Usage

CreateProperty creates named properties that can be retrieved with the get_Property method. Properties can be referenced either by name or by position but not by both.

Newly created properties are set to a default value, which is a VARIANT of type VT_I4 (4-byte integer), with a value of 0.

Call CreatePropertyByPosition to create indexed properties (retrieved with CreatePropertyByPosition).

See also

CreateProperty, get_Property, CreatePropertyByPosition, ISharedProperty interface




ISharedPropertyGroup::CreatePropertyByPosition

Description

Creates a new shared property by position.

Syntax

#include <jagctx.h>
#include <JagSharedProp.h>

HRESULT ISharedPropertyGroup::CreatePropertyByPosition (
        INT position,
        VARIANT_BOOL* pfAlreadyExisted,
        ISharedProperty ** ppProperty
);

Parameters

position

The index by which the property will be referred.

pfAlreadyExisted

The address of a VARIANT_BOOL variable. On output, set to VARIANT_TRUE if the property already existed or VARIANT_FALSE otherwise. pfAlreadyExisted can be NULL if you do not care whether the property existed previously.

ppProperty

On output, a reference to a ISharedProperty object for the property or NULL if an error occurred.

Returns

Return value

To indicate

S_OK

Success.

E_INVALIDARG

Either name or ppProperty was NULL.

Usage

CreatePropertyByPosition creates indexed properties that can be retrieved with the get_PropertyByPosition method. Properties can be referenced either by name or by position but not by both means.

Newly created properties are set to a default value, which is a VARIANT of type VT_I4 (4-byte integer), with a value of 0.

Call CreateProperty to create named properties (retrieved with get_Property).

See also

CreateProperty, get_Property, get_PropertyByPosition




ISharedPropertyGroup::get_Property

Description

Retrieves a reference to a named property.

Syntax

#include <jagctx.h>
#include <JagSharedProp.h>

HRESULT ISharedPropertyGroup::get_Property (
        BSTR propertyName,
        ISharedProperty ** ppProp
);

Parameters

propertyName

The name of the property to be retrieved.

ppProp

On output, a reference to a ISharedProperty object for the property or NULL if an error occurred.

Returns

Return value

To indicate

S_OK

Success.

E_INVALIDARG

Either name or ppProp was NULL or no property with the specified name exists in this property group.

Usage

Named properties are created with the CreateProperty method.

get_Property fails if the requested property has not been created. Call CreateProperty when you are not sure whether a property exists yet. CreateProperty retrieves existing properties or creates them if they do not already exist.

See also

CreateProperty, CreatePropertyByPosition, get_PropertyByPosition




ISharedPropertyGroup::get_PropertyByPosition

Description

Retrieves a reference to an indexed property.

Syntax

#include <jagctx.h>
#include <JagSharedProp.h>

HRESULT ISharedPropertyGroup::get_PropertyByPosition (
        INT position,
        ISharedProperty ** ppProp
);

Parameters

position

The index of the property to be retrieved.

ppProp

On output, a reference to a ISharedProperty object for the property or NULL if an error occurred.

Returns

Return value

To indicate

S_OK

Success.

E_INVALIDARG

ppProp was NULL or no property with the specified index exists in this property group.

Usage

Indexed properties are created with the CreatePropertyByPosition method.

get_PropertyByPosition fails if the requested property has not been created. Call CreatePropertyByPosition when you are not sure whether a property exists yet. CreatePropertyByPosition retrieves existing properties or creates them if they do not already exist.

See also

CreateProperty, CreatePropertyByPosition, get_Property