I am trying to retrieve the list of available choices for an enumeration node.
I was expecting that this could be achieved via (featurename=“PixelFormat”)
my_function(const Cvb::String &featurename, std::vector<Cvb::EnumEntryNodePtr> &list)
std::map<Cvb::String, Cvb::NodeMapPtr> nodemap = pDevice->NodeMaps();
Cvb::String devicemapname = CVB_LIT("Device");
Cvb::NodeMapPtr devicemapptr = pDevice->NodeMap(devicemapname);
auto featurenode = devicemapptr->Node<Cvb::EnumerationNode>(featurename);
list = featurenode->Entries();
However, the last line (“list =…”) creates a heap corruption error message, and the program crashes (as does std::cerr << featurenode->Entries().size() , so it´s not a problem with the “list” parameter).
QString featurevalue = Cvb::CvbStringToQString(featurenode->Value());
std::string nodename_utf8 = featurevalue.toUtf8();
std::cerr << "Node value=" << nodename_utf8 << std::endl;
gives a valid output (“Mono12”); so the pointer (featurenode) is valid.
What could be going wrong here?
What do I need to do in order to use Entries() ?
Version is 13.000.005