# MTRcd

The RCD (Runtime Configuration Dispenser) returns a list of files from the extension folder.

The interface supports looking up the string for a MetraTech-specific error code.

## MTRcd Methods

AddErrorResourceLibrary | Adds a resource DLL to the path for use by ErrorMessage().
RunQuery | Registers a callback based on the query.
RunQueryInAlternateFolder | Returns the list of extensions with a full path.

## MTRcd Properties

ConfigDir | Returns the MetraTech configuration directory.
ErrorMessage | Looks up a MetraTech error code.
ExtensionDir | Gets the Extension directory.
ExtensionList | Returns the list of extensions on the system.
ExtensionListWithPath | Returns the list of extensions with the full path.
InstallDir | Returns the MetraTech installation directory.

## Example

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

# Method Detail

## AddErrorResourceLibrary

Adds a resource DLL to the path for use by ErrorMessage().

### Visual Basic Syntax

Sub AddErrorResourceLibrary(filename As String)

### C++ Syntax

HRESULT AddErrorResourceLibrary([in] BSTR filename);

### Arguments

filename

The name of the DLL to be used by the ErrorMessage property.

## RunQuery

Runs a query on the extensions folder and returns a list of matches.

### Visual Basic Syntax

Function RunQuery(query As String, bRecurse As Boolean) As MTRcdFileList

### C++ Syntax

HRESULT RunQuery([in] BSTR query, [in] VARIANT_BOOL bRecurse, [out,retval] IMTRcdFileList** ppFileList);

### Arguments

query

Examples:

- Config\*.xml finds all xml files in all extensions

- Config\service\*.xml finds all the service definitions

bRecurse

True to recurse subfolders; False to not search subfolders.

### Return Value

Returns a MTRcdFileList object containing a list of extensions.

## RunQueryInAlternateFolder

Runs a query on the AlternateFolder parameter and returns a list of matches.

### Visual Basic Syntax

Function RunQueryInAlternateFolder(
query As String,
bRecurse As Boolean,
AlternateFolder As String)
As MTRcdFileList

### C++ Syntax

HRESULT RunQueryInAlternateFolder(
[in] BSTR query,
[in] VARIANT_BOOL bRecurse,
[in] BSTR AlternateFolder,
[out,retval] IMTRcdFileList** ppFileList);

### Arguments

query

Same as RunQuery() but the operation is only performed in the alternate folder.

bRecurse

True to recurse subfolders; False to not search subfolders.

AlternateFolder

Specific folder to search instead of the extensions folder.

### Return Value

Returns a MTRcdFileList object containing a list of extensions.

# Property Detail

## ConfigDir

Returns the MetraTech configuration directory, for example c:\MetraTech\rmp\config.

This is a read-only property.

### Visual Basic Syntax

Property ConfigDir As String

### C++ Syntax

HRESULT ConfigDir([out, retval] BSTR *pVal);

### Return Value

The path of the configuration directory.

## ErrorMessage

Looks up a MetraTech error code.

This property is read only.

### Visual Basic Syntax

Property ErrorMessage(aErrorCode As Long) As String

### C++ Syntax

HRESULT ErrorMessage([in] long aErrorCode, [out, retval] BSTR *pVal);

### Arguments

aErrorCode

The error code.

### Return Value

The error message corresponding to the error code passed as an argument.

## ExtensionDir

Gets the extention directory, for example c:\MetraTech\rmp\Extension.

This property is read only.

### Visual Basic Syntax

Property ExtensionDir As String

### C++ Syntax

HRESULT ExtensionDir([out, retval] BSTR *pVal);

### Return Value

The extension directory.

## ExtensionList

Returns the names of all extensions on the system.

This is a read-only property.

### Visual Basic Syntax

Property ExtensionList As MTRcdFileList

### C++ Syntax

HRESULT ExtensionList([out, retval] IMTRcdFileList* *pVal);

### Return Value

Returns a MTRcdFileList object containing a list of extensions.

## ExtensionListWithPath

Returns the list of extensions with full pathnames.

This is a read-only property.

### Visual Basic Syntax

Property ExtensionListWithPath As MTRcdFileList

### C++ Syntax

HRESULT ExtensionListWithPath([out, retval] IMTRcdFileList* *pVal);

### Return Value

Returns a MTRcdFileList object containing a list of extensions, with full pathnames.

## InstallDir

Gets the MetraTech installation directory, for example c:\MetraTech\rmp.

This is a read-only property.

### Visual Basic Syntax

Property InstallDir As String

### C++ Syntax

HRESULT InstallDir([out, retval] BSTR *pVal);

### Return Value

The path of the MetraTech installation directory.