No error handling needed?
Can you check that TDictionary::GetDictionary(myLeaf->GetTypeName()) is indeed a TDataType?
Can you then use its GetType() to get its numerical representation, and then use that to get the dict - instead of doing a second string lookup?