# MTConfig

The MTConfig object is responsible for reading configuration information into local in-memory objects from a variety of sources including files, hosts, and strings. After successfully reading in the configuration information, a configuration property set (MTConfigPropSet) is returned.

## Program ID

MetraTech.MTConfig.1

## MTConfig Methods

NewConfiguration | Creates a new instance of a configuration property set with the given name and returns it.
ReadConfiguration | Reads in the given configuration file and returns a configuration property set.
ReadConfigurationFromHost | Reads the product configuration from a remote host and returns a configuration property set.
ReadConfigurationFromString | Reads the product configuration from a string buffer and returns a configuration property set.
ReadConfigurationFromURL | Reads the product configuration from a URL and returns a configuration property set.
ReadFromURLInternal | Reads the product configuration from a URL and returns a configuration property set (internal use, not exported). Used to implement the common functionality between ReadConfiguationFromURL and ReadConfigurationFromHost.

## MTConfig Properties

AutoEnumConversion | Gets/sets the value of the AutoEnumConversion flag.
ChecksumSwitch | Gets/sets the value of the checksum switch.
Password | Gets/sets the password (the password for what ???).
Port | Gets/sets the port. This is used to specifiy a port on a remote host to connect to. If not specified the default port for the given protocol will be used.
SecureFlag | Gets/sets the secure flag. This flag determines whether to use SSL or not when connecting to remote hosts.
Username | Gets/sets the username used when reading from a remote host.

## Example

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

# Method Detail

## NewConfiguration

Creates a new instance of a configuration property set with the given name and returns it.

### Visual Basic Syntax

Function NewConfiguration(aName As String) As MTConfigPropSet

### C++ Syntax

STDMETHODIMP CMTConfig::NewConfiguration(BSTR aName, IMTConfigPropSet * * apSet)

### Arguments

aName

The name of the new config prop set.

### Return Value

The new, empty config property set as a MTConfigPropSet object.

## ReadConfigurationFromString

Reads the product configuration from a string buffer and returns a configuration property set.

### Visual Basic Syntax

Function ReadConfigurationFromString(aConfigBuffer As String, apChecksumMatch As Boolean) As MTConfigPropSet

### C++ Syntax

STDMETHODIMP CMTConfig::ReadConfigurationFromString(
BSTR aConfigBuffer,
VARIANT_BOOL* apChecksumMatch,
IMTConfigPropSet * * apSet)

### Arguments

aConfigBuffer

The string.

apChecksumMatch

Describes whether the MD5 checksum matched or not.

### Return Value

The ConfigPropSet object.

## ReadConfigurationFromHost

Reads the product configuration from a remote host and returns a configuration property set.

### Visual Basic Syntax

Function ReadConfigurationFromHost(aHostName As String, aRelativePath As String, aSecure As Boolean, apChecksumMatch As Boolean) As MTConfigPropSet

### C++ Syntax

STDMETHODIMP CMTConfig::ReadConfigurationFromHost(
BSTR aHostName,
BSTR aRelativePath,
VARIANT_BOOL aSecure,
VARIANT_BOOL* apChecksumMatch,
MTConfigPropSet * * apSet)

### Arguments

aHostName

The name of the remote host.

aRelativePath

The relative path to the configuration files on the remote host.

aSecure

Determines whether SSL is used.

apChecksumMatch

Describes whether the MD5 checksum matched or not.

### Return Value

The ConfigPropSet object.

## ReadConfigurationFromURL

Reads the product configuration from a URL and returns a configuration property set.

### Visual Basic Syntax

Function ReadConfigurationFromURL(aURL As String, apChecksumMatch As Boolean) As MTConfigPropSet

### C++ Syntax

STDMETHODIMP CMTConfig::ReadConfigurationFromURL(
BSTR aURL,
VARIANT_BOOL* apChecksumMatch,
IMTConfigPropSet * * apSet)

### Arguments

aURL

The URL where the configuration is located.

apChecksumMatch

Describes whether the MD5 checksum matched or not.

### Return Value

The ConfigPropSet object.

## ReadFromURLInternal

Reads the product configuration from a URL and returns a configuration property set (internal use, not exported). Used to implement the common functionality between ReadConfiguationFromURL and ReadConfigurationFromHost.

### Visual Basic Syntax

N/A

### C++ Syntax

HRESULT CMTConfig::ReadFromURLInternal(
const char * apURL,
VARIANT_BOOL * apChecksumMatch,
IMTConfigPropSet * * apSet)

### Arguments

aURL

The URL where the configuration is located.

apChecksumMatch

Describes whether the MD5 checksum matched or not.

### Return Value

The ConfigPropSet object.

## ReadConfiguration

Reads in the given configuration file and returns a configuration property set.

### Visual Basic Syntax

Function ReadConfiguration(aFilename As String, apChecksumMatch As Boolean) As MTConfigPropSet

### C++ Syntax

STDMETHODIMP CMTConfig::ReadConfiguration(
BSTR aFilename,
VARIANT_BOOL* apChecksumMatch,
IMTConfigPropSet * * apSet)

### Arguments

aFilename

The name of the config file.

apChecksumMatch

Describes whether the MD5 checksum matched or not.

### Return Value

The ConfigPropSet object.

# Property Detail

## AutoEnumConversion

Gets/sets the value of the AutoEnumConversion flag.

### Visual Basic Syntax

Property AutoEnumConversion As Boolean

### C++ Syntax

STDMETHODIMP CMTConfig::put_AutoEnumConversion(/*[in]*/ VARIANT_BOOL aConvert)

STDMETHODIMP CMTConfig::get_AutoEnumConversion(/*[out, retval]*/ VARIANT_BOOL * apConvert)

### Arguments

aConvert

The new AutoEnumConversion value.

### Return Value

apConvert

The AutoEnumConversion flag's value.

## CheckSumSwitch

Gets/sets the value of the checksum switch.

### Visual Basic Syntax

Property ChecksumSwitch as Boolean

### C++ Syntax

STDMETHODIMP CMTConfig::get_ChecksumSwitch(VARIANT_BOOL *apVal)

STDMETHODIMP CMTConfig::put_ChecksumSwitch(VARIANT_BOOL aNewVal)

### Arguments

aNewVal

The new checksum switch value.

### Return Value

apVal

The value of the checksum switch.

## Password

Gets/sets the password for remotely getting the MTConfig object.

### Visual Basic Syntax

Property Password As String

### C++ Syntax

STDMETHODIMP CMTConfig::put_Password(/*[in]*/ BSTR aPassword)

STDMETHODIMP CMTConfig::get_Password(/*[out, retval]*/ BSTR * apPassword)

### Arguments

aPassword

The new password.

### Return Value

apPassword

The password.

## Port

Gets/sets the port. This is used to specifiy a port on a remote host to connect to. If not specified the default port for the given protocol will be used.

### Visual Basic Syntax

Property Port as Long

### C++ Syntax

STDMETHODIMP CMTConfig::put_Port(/*[in]*/ int aPort)

STDMETHODIMP CMTConfig::get_Port(/*[out, retval]*/ int * apPort)

### Return Value

apPort

The port.

## SecureFlag

Gets/sets the secure flag. This flag determines whether to use SSL or not when connecting to remote hosts.

### Visual Basic Syntax

Property SecureFlag As Boolean

### C++ Syntax

STDMETHODIMP CMTConfig::put_SecureFlag(/*[in]*/ VARIANT_BOOL aSecureFlag)

STDMETHODIMP CMTConfig::get_SecureFlag(/*[out, retval]*/ VARIANT_BOOL * apSecureFlag)

### Arguments

aSecureFlag

The new value of the secure flag.

### Return Value

apSecureFlag

The value of the secure flag.

## Username

Gets/sets the username used when reading from a remote host.

### Visual Basic Syntax

Property Username As String

### C++ Syntax

STDMETHODIMP CMTConfig::put_Username(/*[in]*/ BSTR aUsername)

STDMETHODIMP CMTConfig::get_Username(/*[out, retval]*/ BSTR * apUsername)

### Arguments

aUsername

The new username.

### Return Value

apUsername

The username.