# IRdStrEnum Interface Reference

Inherits IDispatch, and IDispatch.

List of all members.

## Public Member Functions
HRESULT | Clear (void)
HRESULT | SetSize ([in] RtUlong ulSize)
HRESULT | GetSize ([out, retval] RtUlong *pulSize)
HRESULT | SetStringAt ([in] RtUlong ulIndex,[in] BSTR bsStr)
HRESULT | GetStringAt ([in] RtUlong ulIndex,[out, retval] BSTR *pbsStr)
HRESULT | SetSelectedString ([in] BSTR bsStr)
HRESULT | GetSelectedString ([out, retval] BSTR *pbsStr)
HRESULT | SetComboCtrlStyle ([in] RtDWORD dwStyle)
HRESULT | GetComboCtrlStyle ([out, retval] RtDWORD *pdwStyle)
HRESULT | Clear (void)
HRESULT | SetSize ([in] RtUlong ulSize)
HRESULT | GetSize ([out, retval] RtUlong *pulSize)
HRESULT | SetStringAt ([in] RtUlong ulIndex,[in] BSTR bsStr)
HRESULT | GetStringAt ([in] RtUlong ulIndex,[out, retval] BSTR *pbsStr)
HRESULT | SetSelectedString ([in] BSTR bsStr)
HRESULT | GetSelectedString ([out, retval] BSTR *pbsStr)
HRESULT | SetComboCtrlStyle ([in] RtDWORD dwStyle)
HRESULT | GetComboCtrlStyle ([out, retval] RtDWORD *pdwStyle)

## Detailed Description

IRdStrEnum was designed to store string values for dynamic combo box controls.

- More generally, it can be used as a general-purpose string array (one dimensional) as well.
- In essence a one-dimension array, however you could consider the string as an array in itself. So loosely we can claim that IRdStrEnum is possible to be an array of arrays.
- Caution using 0 in array as this usually indicates end of string.

## Member Function Documentation

HRESULT IRdStrEnum::Clear | ( | void |  | ) |

Clear (initialize) the data object.

        var myStringEnumArray = System.CreateDO('Common Data Package/String Enum Data');
        myStringEnumArray.Clear();

HRESULT IRdStrEnum::SetSize | ( | [in] RtUlong | ulSize | ) |

Sets size (number of items) that the data object can store

Parameters:

  | ulSize | [in] Desired size of array.

        myStringEnumArray.SetSize(10);

HRESULT IRdStrEnum::GetSize | ( | [out, retval] RtUlong * | pulSize | ) |

Gets size (number of items) that the data object is storing.

Returns:
  pulSize [out, retval] Returns size of array.

        var sizeIs = myStringEnumArray.GetSize();
        System.Alert(sizeIs);

HRESULT IRdStrEnum::SetStringAt | ( | [in] RtUlong | ulIndex,
|  | [in] BSTR | bsStr |
| ) |  |  |

Sets one string item to the collection

Parameters:

  | ulIndex | [in] Zero based index of new item (0..GetSize-1).
  | bsStr | [in] String item to be set.

        myStringEnumArray.SetStringAt(5, "An array-a-day keeps the nerds at bay");

HRESULT IRdStrEnum::GetStringAt | ( | [in] RtUlong | ulIndex,
|  | [out, retval] BSTR * | pbsStr |
| ) |  |  |

Gets one string item from the collection.

Parameters:

  | ulIndex | [in] Zero based index of the item (0..GetSize-1).

Returns:
  pbsStr [out, retval] Returns string item at given index.

        var stringIs = myStringEnumArray.GetStringAt(5);
        System.Alert(stringIs);

HRESULT IRdStrEnum::SetSelectedString | ( | [in] BSTR | bsStr | ) |

Sets the default string (default value of combo box control)

Parameters:

  | bsStr | [in] Default value (should be one of the collection items).

        var stringIs = myStringEnumArray.GetStringAt(5);
        myStringEnumArray.SetSelectedString(stringIs);

HRESULT IRdStrEnum::GetSelectedString | ( | [out, retval] BSTR * | pbsStr | ) |

Gets the default string (default value of combo box control).

Returns:
  pbsStr [out, retval] Returns default value.

        var defaultString = myStringEnumArray.GetSelectedString();
        System.Alert(defaultString);

HRESULT IRdStrEnum::SetComboCtrlStyle | ( | [in] RtDWORD | dwStyle | ) |

Sets style for combo box control.

Parameters:

  | dwStyle | [in] Style constant - use one of the MS WIN style constants:

- CBS_SIMPLE 0x0001L
- CBS_DROPDOWN 0x0002L
- CBS_DROPDOWNLIST 0x0003L

        myStringEnumArray.SetComboCtrlStyle(1);

HRESULT IRdStrEnum::GetComboCtrlStyle | ( | [out, retval] RtDWORD * | pdwStyle | ) |

Gets style for combo box control.

Returns:
  pdwStyle [out, retval] Returns combo box style (see the SetComboCtrlStyle desc).

          var styleIs = myStringEnumArray.GetComboCtrlStyle();
          System.Alert(styleIs);

HRESULT IRdStrEnum::Clear | ( | void |  | ) |

Clear (initialize) the data object.

        var myStringEnumArray = System.CreateDO('Common Data Package/String Enum Data');
        myStringEnumArray.Clear();

HRESULT IRdStrEnum::SetSize | ( | [in] RtUlong | ulSize | ) |

Sets size (number of items) that the data object can store

Parameters:

  | ulSize | [in] Desired size of array.

        myStringEnumArray.SetSize(10);

HRESULT IRdStrEnum::GetSize | ( | [out, retval] RtUlong * | pulSize | ) |

Gets size (number of items) that the data object is storing.

Returns:
  pulSize [out, retval] Returns size of array.

        var sizeIs = myStringEnumArray.GetSize();
        System.Alert(sizeIs);

HRESULT IRdStrEnum::SetStringAt | ( | [in] RtUlong | ulIndex,
|  | [in] BSTR | bsStr |
| ) |  |  |

Sets one string item to the collection

Parameters:

  | ulIndex | [in] Zero based index of new item (0..GetSize-1).
  | bsStr | [in] String item to be set.

        myStringEnumArray.SetStringAt(5, "An array-a-day keeps the nerds at bay");

HRESULT IRdStrEnum::GetStringAt | ( | [in] RtUlong | ulIndex,
|  | [out, retval] BSTR * | pbsStr |
| ) |  |  |

Gets one string item from the collection.

Parameters:

  | ulIndex | [in] Zero based index of the item (0..GetSize-1).

Returns:
  pbsStr [out, retval] Returns string item at given index.

        var stringIs = myStringEnumArray.GetStringAt(5);
        System.Alert(stringIs);

HRESULT IRdStrEnum::SetSelectedString | ( | [in] BSTR | bsStr | ) |

Sets the default string (default value of combo box control)

Parameters:

  | bsStr | [in] Default value (should be one of the collection items).

        var stringIs = myStringEnumArray.GetStringAt(5);
        myStringEnumArray.SetSelectedString(stringIs);

HRESULT IRdStrEnum::GetSelectedString | ( | [out, retval] BSTR * | pbsStr | ) |

Gets the default string (default value of combo box control).

Returns:
  pbsStr [out, retval] Returns default value.

        var defaultString = myStringEnumArray.GetSelectedString();
        System.Alert(defaultString);

HRESULT IRdStrEnum::SetComboCtrlStyle | ( | [in] RtDWORD | dwStyle | ) |

Sets style for combo box control.

Parameters:

  | dwStyle | [in] Style constant - use one of the MS WIN style constants:

- CBS_SIMPLE 0x0001L
- CBS_DROPDOWN 0x0002L
- CBS_DROPDOWNLIST 0x0003L

        myStringEnumArray.SetComboCtrlStyle(1);

HRESULT IRdStrEnum::GetComboCtrlStyle | ( | [out, retval] RtDWORD * | pdwStyle | ) |

Gets style for combo box control.

Returns:
  pdwStyle [out, retval] Returns combo box style (see the SetComboCtrlStyle desc).

          var styleIs = myStringEnumArray.GetComboCtrlStyle();
          System.Alert(styleIs);