# MTConfigPropSet

The MTConfigPropSet object is a collection of configuration properties (MTConfigProp). Along with being a container for these objects, this class also provides various ways to iterate through a collection and to search for a specific configuration property contained within it.

## Program ID

MTConfigPropSet.MTConfigPropSet.1

## MTConfigPropSet Methods

AddSubSet | A recursive function that adds an existing property set to a new property set.
ChecksumRefresh | Recalculates the checksum after a property set is modified.
InsertConfigProp | Inserts the given property into a set immediately after the current property.
InsertProp | Creates and inserts a new property in a set immediately after the current property.
InsertSet | Adds a subset into the current property set.
Next | Returns the next property in the set.
NextBoolWithName | Gets the next property of type Boolean with the given name and returns its value.
NextDateWithName | Get the next property of type date with the given name and returns its value.
NextDecimalWithName | Gets the next property of type variant with the given name and returns its value.
NextDoubleWithName | Gets the next property of type double with the given name and returns its value.
NextLongWithName | Gets the next property of type long with the given name and returns its value.
NextMatches | Searches forward in the set to check whether there is a property that matches the name and type given. The cursor is returned back to the original position.
NextSetWithName | Gets the next property set with the given name.
NextStringWithName | Gets the next property of type string with the given name and returns its value.
NextVariantWithName | Gets the next property of type variant with the given name and returns its value.
NextWithName | Gets the next property with the given name.
Previous | Returns the previous property in the set.
Reset | Sets the property set back to its original state. Calling Next after this call will return the first property in the set.
Write | Writes the given property set as an XML file with the name given.
WriteToBuffer | Writes the property set as XML code in a buffer.
WriteToHost | Writes the given property set as an XML file on a remote host.
WriteWithChecksum | Writes the property set as an XML file with the name given, placing a checksum at the top of the file.

## MTConfigPropSet Properties

AttribSet | Gets/Sets the XML attributes of the property set.
Checksum | Gets the checksum of the property set.
DTD | Gets/sets the DTD of the XML document (if it exists).
Name | Gets the name of the property set.

## Example

Example to be provided in a future release of this online help system.

# Method Details

## Next

Returns the next property in the set.

### Visual Basic Syntax

Function Next() As MTConfigProp

### C++ Syntax

STDMETHODIMP CMTConfigPropset::Next (IMTConfigProp * * apProp)

### Return Value

The next property in the set as an MTConfigProp object.

## NextDecimalWithName

Gets the next property of type variant with the given name and returns its value.

### Visual Basic Syntax

Function NextDecimalWithName(aName As String) As Variant

### C++ Syntax

HRESULT NextDecimalWithName([in]BSTR aName, [out,retval] VARIANT * apVal);

### Arguments

BSTR aName

The name of the property

### Return Value

The value of the property.

### Errors Raised

"No decimal found with name"

## Previous

Returns the previous property in the set.

### Visual Basic Syntax

Function Previous() As MTConfigProp

### C++ Syntax

STDMETHODIMP CMTConfigPropSet::Previous (IMTConfigProp * * apProp)

### Arguments

None.

### Return Value

The previous property in the set as an MTConfigProp object.

## Reset

Sets the property set back to its original state. Calling Next after this call will return the first property in the set.

### Visual Basic Syntax

Sub Reset()

### C++ Syntax

STDMETHODIMP CMTConfigPropset::Reset ()

## NextWithName

Gets the next property with the given name.

### Visual Basic Syntax

Function NextSetWithName(aName As String) As MTConfigProp

### C++ Syntax

STDMETHODIMP CMTConfigPropset::NextWithName (BSTR aName, IMTConfigProp * * apProp)

### Arguments

aName

The name of the property.

### Return Value

The property as an MTConfigProp object.

## NextMatches

Searches forward in the set to check whether there is a property that matches the name and type given. The cursor is returned back to the original position.

### Visual Basic Syntax

Function NextMatches(aPropName As String, aType As PropValType) As Boolean

### C++ Syntax

STDMETHODIMP CMTConfigPropset::NextMatches (
/*[in]*/ BSTR aPropName,
/*[in]*/ PropValType aType,
[out, retval]*/ VARIANT_BOOL * apMatch)

### Arguments

aPropName

The name of the property.

aType

The type of the property. The legal values are listed in the enumerated type, PropValType.

### Return Value

Determines whether a match exists. True if a match exists; False otherwise.

## NextLongWithName

Gets the next property of type long with the given name and returns its value.

### Visual Basic Syntax

Function NextLongWithName(aName As String) As Long

### C++ Syntax

STDMETHODIMP CMTConfigPropset::NextLongWithName (BSTR aName, long * apVal)

### Arguments

aName

The name of the property.

### Return Value

The value of the property as a long.

### Errors Raised

No long found with name.

## NextStringWithName

Gets the next property of type string with the given name and returns its value.

### Visual Basic Syntax

Function NextStringWithName(aName As String) As String

### C++ Syntax

STDMETHODIMP CMTConfigPropset::NestStringWithName (BSTR aName, BSTR * apVal)

### Arguments

aName

The name of the property.

### Return Value

The value of the property as a string.

### Errors Raised

No string found with name.

## NextBoolWithName

Gets the next property of type Boolean with the given name and returns its value.

### Visual Basic Syntax

Function NextBoolWithName(aName As String) As Boolean

### C++ Syntax

STDMETHODIMP CMTConfigPropset::NextBoolWithName (BSTR aName, VARIANT_BOOL * apVal)

### Arguments

BSTR aName

The name of the property.

### Return Value

The value of the property.

### Errors Raised

No Boolean found with name.

## NextVariantWithName

Gets the next property of type variant with the given name and returns its value.

### Visual Basic Syntax

Function NextVariantWithName(aName As String, apType As PropValType)

### C++ Syntax

STDMETHODIMP CMTConfigPropset::NextVariantWithName (BSTR aName, PropValType * apType, VARIANT * apVal)

### Arguments

aName

The name of the property.

### Return Value

apType

The type of the variant. The legal values are listed in the enumerated type, PropValType.

apVal

The value of the property as a variant.

### Errors Raised

No variant found with name.

## NextDoubleWithName

Gets the next property of type double with the given name and returns its value.

### Visual Basic Syntax

Function NextDoubleWithName(aName As String) As Double

### C++ Syntax

STDMETHODIMP CMTConfigPropset::NextDoubleWithName (BSTR aName, double * apVal)

### Arguments

aName

The name of the property.

### Return Value

The value of the property as a double.

### Errors Raised

No double found with name.

## NextSetWithName

Gets the next property set with the given name.

### Visual Basic Syntax

Function NextSetWithName(aName As String) As MTConfigPropSet

### C++ Syntax

STDMETHODIMP CMTConfigPropset:: NextSetWithName (BSTR aName, IMTConfigPropSet * * apSet)

### Arguments

aName

The name of the property.

### Return Value

The property set as an MTConfigPropSet.

### Errors Raised

E_INVALIDARG: Returned if the next value with this name is not a set.

## InsertSet

Adds a subset into the current property set.

### Visual Basic Syntax

Function InsertSet(aName As String) As MTConfigPropSet

### C++ Syntax

STDMETHODIMP CMTConfigPropset::InsertSet (BSTR aName, IMTConfigPropSet * * apNewSet)

### Arguments

aName

The name of the property set.

apNewSet

The name of the set to be inserted.

## AddSubSet

A recursive function that adds an existing property set to a new property set.

### Visual Basic Syntax

Sub AddSubSet(apNewSet As MTConfigPropSet)

### C++ Syntax

STDMETHODIMP CMTConfigPropset::AddSubSet (IMTConfigPropSet * apNewSet)

### Arguments

apNewSet

The property set to be added.

## InsertProp

Creates and inserts a new property in a set immediately after the current property.

### Visual Basic Syntax

Sub InsertProp(aName As String, aType As PropValType, aVal)

### C++ Syntax

STDMETHODIMP CMTConfigPropset::InsertProp (BSTR aName, PropValType aType, VARIANT aVal)

### Arguments

aName

The name of the property set.

aType

The type of the property. The legal values are listed in the enumerated type, PropValType.

aVal

The value of the property.

## InsertConfigProp

Inserts the given property into a set immediately after the current property.

### Visual Basic Syntax

Sub InsertConfigProp(pProp As MTConfigProp)

### C++ Syntax

STDMETHODIMP CMTConfigPropset::InsertConfigProp (IMTConfigProp * pProp)

### Arguments

pProp

The property to be inserted, as a ConfigProp object.

### Errors Raised

Can't query for CMTConfigProp C++ object.

## Write

Writes the given property set as an XML file with the name given.

### Visual Basic Syntax

Sub Write(aFilename As String)

### C++ Syntax

STDMETHODIMP CMTConfigPropset::Write (BSTR aFilename)

### Arguments

aFilename

The name of the file to write the properties in.

## ChecksumRefresh

Recalculates the checksum after a property set is modified.

### Visual Basic Syntax

N/A

### C++ Syntax

STDMETHODIMP CMTConfigPropset::ChecksumRefresh ()

## WriteWithChecksum

Writes the property set as an XML file with the name given, placing a checksum at the top of the file.

### Visual Basic Syntax

Sub WriteWithChecksum(aFilename As String)

### C++ Syntax

STDMETHODIMP CMTConfigPropset::WriteWithChecksum (BSTR aFilename)

### Arguments

aFilename

The name of the file in which to write the property set.

## WriteToHost

Writes the given property set as an XML file on a remote host.

### Visual Basic Syntax

Sub WriteToHost(aHostName As String, aRelativePath As String, aUsername As String, aPassword As String, aSecure As Boolean, aChecksum As Boolean)

### C++ Syntax

STDMETHODIMP CMTConfigPropset::WriteToHost (
BSTR aHostName,
BSTR aRelativePath,
BSTR aUsername,
BSTR aPassword,
VARIANT_BOOL aSecure,
VARIANT_BOOL aChecksum)

### Arguments

aHostName

The host name.

aRelativePath

The relative path.

aUsername

The user name.

aPassword

The password associated with the user name.

aSecure

If true, will use SSL.

aChecksum

### Errors Raised

CORE_ERR_BAD_HTTP_RESPONSE: If a bad HTTP response is returned.

## WriteToBuffer

Writes the property set as XML code in a buffer.

### Visual Basic Syntax

Function WriteToBuffer() As String

### C++ Syntax

STDMETHODIMP CMTConfigPropset::WriteToBuffer (BSTR * apVal)

### Argument

The name of the buffer.

## NextDateWithName

Gets the next property of type date with the given name and returns its value.

### Visual Basic Syntax

Function NextDateWithName(aName As String) As Date

### C++ Syntax

STDMETHODIMP CMTConfigPropset::NextDateWithName (BSTR aName, DATE * pDate)

### Arguments

aName

The name of the property.

### Return Value

The value of the property as a Date.

### Errors Raised

No date found with name.

# Property Details

## AttribSet

Gets/sets the XML attributes for this property set.

### Visual Basic Syntax

Property AttribSet As MTConfigAttribSet

### C++ Syntax

STDMETHODIMP CMTConfigPropset::get_AttribSet (IMTConfigAttribSet * * ppSet)

STDMETHODIMP CMTConfigPropset::put_AttribSet (IMTConfigAttribSet * pSet)

### Arguments

pSet

The set of XML attributes.

### Return Value

ppSet

The set of XML attributes.

## Checksum

Gets the checksum of the property set.

This is a read-only property.

### Visual Basic Syntax

Property Checksum as String

### C++ Syntax

STDMETHODIMP CMTConfigPropset::get_Checksum (BSTR * pChecksum)

### Return Value

The checksum.

## DTD

Gets/sets the DTD of the XML document.

### Visual Basic Syntax

Property DTD As String

### C++ Syntax

STDMETHODIMP CMTConfigPropset::get_DTD (BSTR * pVal)

STDMETHODIMP CMTConfigPropset::put_DTD (BSTR newVal)

### Arguments

newVal

The new DTD of the XML document.

### Return Value

pVal

The DTD of the XML document (if it exists).

## Name

Gets the name of the property set.

This is a read-only property.

### Visual Basic Syntax

Property Name As String

### C++ Syntax

STDMETHODIMP CMTConfigPropset::get_Name (BSTR * Name)

### Return Value

The name of the propset.