I came up with this solution which is working fine. Thanks for your help.
std::string
getDropDownName(Description* const description,
Int32 group_id,
Int32 SelectedItem)
{
const DescID* singleid = description->GetSingleDescID();
const DescID cid = DescLevel(group_id, DTYPE_LONG, 0);
std::string selected_name = "";
if (!singleid || cid.IsPartOf(*singleid, nullptr))
{
AutoAlloc<AtomArray> arr;
BaseContainer* selectionParameter =
description->GetParameterI(DescLevel(group_id, DTYPE_LONG, 0), arr);
if (selectionParameter != nullptr)
{
BaseContainer* items =
selectionParameter->GetContainerInstance(DESC_CYCLE);
if (items != nullptr)
{
selected_name =
items->GetData(SelectedItem).GetString().GetCStringCopy();
}
}
}
return selected_name;
}