本文整理汇总了C++中CDesignType::AddExternals方法的典型用法代码示例。如果您正苦于以下问题:C++ CDesignType::AddExternals方法的具体用法?C++ CDesignType::AddExternals怎么用?C++ CDesignType::AddExternals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDesignType
的用法示例。
在下文中一共展示了CDesignType::AddExternals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadDesignType
ALERROR CExtension::LoadDesignType (SDesignLoadCtx &Ctx, CXMLElement *pDesc, CDesignType **retpType)
// LoadDesignType
//
// Loads a standard design type
{
ALERROR error;
CDesignType *pType = NULL;
// Load topology
if (strEquals(pDesc->GetTag(), STAR_SYSTEM_TOPOLOGY_TAG)
|| strEquals(pDesc->GetTag(), SYSTEM_TOPOLOGY_TAG))
{
if (error = m_Topology.LoadFromXML(Ctx, pDesc, NULL, NULL_STR))
return error;
}
// <Sound>
else if (strEquals(pDesc->GetTag(), SOUND_TAG))
return LoadSoundElement(Ctx, pDesc);
// <Globals>
else if (strEquals(pDesc->GetTag(), GLOBALS_TAG))
return LoadGlobalsElement(Ctx, pDesc);
// <Library>
else if (strEquals(pDesc->GetTag(), LIBRARY_TAG))
return LoadLibraryElement(Ctx, pDesc);
// <Module>
else if (strEquals(pDesc->GetTag(), MODULE_TAG))
return LoadModuleElement(Ctx, pDesc);
// <Modules>
else if (strEquals(pDesc->GetTag(), MODULES_TAG))
return LoadModulesElement(Ctx, pDesc);
// Load standard design elements
else
{
if (error = CDesignType::CreateFromXML(Ctx, pDesc, &pType))
return error;
DWORD dwUNID = pType->GetUNID();
// Can't use the reserved range
if (IsReservedUNID(dwUNID))
{
Ctx.sError = strPatternSubst(CONSTLIT("Cannot use reserved UNID: %x"), dwUNID);
return ERR_FAIL;
}
// Add to our list
if (error = m_DesignTypes.AddEntry(pType))
{
if (error == ERR_OUTOFROOM)
{
// For backwards compatibility with earlier versions, we
// disable this message.
if (Ctx.GetAPIVersion() >= 12)
{
Ctx.sError = strPatternSubst(CONSTLIT("Duplicate UNID: %x"), dwUNID);
return error;
}
}
else
{
Ctx.sError = strPatternSubst(CONSTLIT("Error adding design entry UNID: %x"), dwUNID);
return error;
}
}
// Let this type add external definitions
pType->AddExternals(&m_Externals);
}
// Done
if (retpType)
*retpType = pType;
return NOERROR;
}