[CONNECT C++ U16.2] Item Type iteration fails

Hello all,

I want to iterate over all Itemtypes in a all Libraries but I get an Memory Exception in the second iteration in following Code:

try
	{
		ItemTypeLibraryPtr itemTypeLibrary = ItemTypeLibrary::FindByName(libName.c_str(), *ISessionMgr::GetActiveDgnFile());

		for (ItemTypeLibrary::iterator iter = itemTypeLibrary->begin(); iter != itemTypeLibrary->end(); ++iter)
		{
			if (WString::IsNullOrEmpty(iter->GetName()))
				continue;
			auto name = iter-> GetName();
		}
	}
	catch (...)
	{
		printf("Error\n");
	}

The Exception appears when I try to retrieve the name or the internalName of the Item Type:

The Try - catch Block is not throwing aswell.

Am I using the iterator in wrong way or is there an alternative possibility to retrieve the Names of all Itemtypes in a library?

Thanks in advance

Manu

Parents Reply Children