本文整理汇总了C++中CExtension::AddDefaultLibraryReferences方法的典型用法代码示例。如果您正苦于以下问题:C++ CExtension::AddDefaultLibraryReferences方法的具体用法?C++ CExtension::AddDefaultLibraryReferences怎么用?C++ CExtension::AddDefaultLibraryReferences使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CExtension
的用法示例。
在下文中一共展示了CExtension::AddDefaultLibraryReferences方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateExtension
ALERROR CExtension::CreateExtension (SDesignLoadCtx &Ctx, CXMLElement *pDesc, EFolderTypes iFolder, CExternalEntityTable *pEntities, CExtension **retpExtension)
// CreateExtension
//
// Loads the given extension or adventure. We take ownership of pEntities.
{
ALERROR error;
int i;
// Create an extension object
CExtension *pExtension;
if (error = CreateExtensionFromRoot(Ctx.sResDb, pDesc, iFolder, pEntities, Ctx.dwInheritAPIVersion, &pExtension, &Ctx.sError))
return error;
// Set up context
Ctx.pExtension = pExtension;
// Load all the design elements
for (i = 0; i < pDesc->GetContentElementCount(); i++)
{
CXMLElement *pItem = pDesc->GetContentElement(i);
if (error = pExtension->LoadDesignElement(Ctx, pItem))
{
pExtension->m_pEntities = NULL; // Let our parent clean up.
delete pExtension;
return error;
}
}
// If this is an adventure and we have no adventure descriptor then we
// fail.
if (pExtension->m_iType == extAdventure && pExtension->m_pAdventureDesc == NULL)
{
pExtension->m_pEntities = NULL; // Let our parent clean up.
delete pExtension;
Ctx.sError = CONSTLIT("Adventure must have an AdventureDesc type.");
return ERR_FAIL;
}
pExtension->AddDefaultLibraryReferences(Ctx);
// Restore
Ctx.pExtension = NULL;
// Done
pExtension->m_iLoadState = (Ctx.bLoadAdventureDesc ? loadAdventureDesc : loadComplete);
*retpExtension = pExtension;
return NOERROR;
}