本文整理汇总了C++中CExtension::SetDisabled方法的典型用法代码示例。如果您正苦于以下问题:C++ CExtension::SetDisabled方法的具体用法?C++ CExtension::SetDisabled怎么用?C++ CExtension::SetDisabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CExtension
的用法示例。
在下文中一共展示了CExtension::SetDisabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateExtensionFromRoot
ALERROR CExtension::CreateExtensionFromRoot (const CString &sFilespec, CXMLElement *pDesc, EFolderTypes iFolder, CExternalEntityTable *pEntities, DWORD dwInheritAPIVersion, CExtension **retpExtension, CString *retsError)
// CreateExtension
//
// Loads the given extension or adventure. We take ownership of pEntities.
{
int i;
// Create an extension object
CExtension *pExtension = new CExtension;
pExtension->m_sFilespec = sFilespec;
pExtension->m_dwUNID = pDesc->GetAttributeInteger(UNID_ATTRIB);
if (pExtension->m_dwUNID == 0)
{
delete pExtension;
*retsError = CONSTLIT("Invalid UNID.");
return ERR_FAIL;
}
if (strEquals(pDesc->GetTag(), TRANSCENDENCE_ADVENTURE_TAG))
{
pExtension->m_iGame = gameTranscendence;
pExtension->m_iType = extAdventure;
}
else if (strEquals(pDesc->GetTag(), TRANSCENDENCE_LIBRARY_TAG))
{
pExtension->m_iGame = gameTranscendence;
pExtension->m_iType = extLibrary;
}
else if (strEquals(pDesc->GetTag(), TRANSCENDENCE_EXTENSION_TAG))
{
pExtension->m_iGame = gameTranscendence;
pExtension->m_iType = extExtension;
}
else if (strEquals(pDesc->GetTag(), CORE_LIBRARY_TAG))
{
// For core libraries, we don't care what game it is. It's always
// whatever game the base file is.
pExtension->m_iGame = gameUnknown;
pExtension->m_iType = extLibrary;
}
else
{
delete pExtension;
*retsError = strPatternSubst(CONSTLIT("Unknown root element: %s"), pDesc->GetTag());
return ERR_FAIL;
}
pExtension->m_iLoadState = loadEntities;
pExtension->m_iFolderType = iFolder;
pExtension->m_pEntities = pEntities;
pExtension->m_ModifiedTime = fileGetModifiedTime(sFilespec);
pExtension->m_bDebugOnly = pDesc->GetAttributeBool(DEBUG_ONLY_ATTRIB);
pExtension->m_bRegistered = IsRegisteredUNID(pExtension->m_dwUNID);
pExtension->m_bPrivate = pDesc->GetAttributeBool(PRIVATE_ATTRIB);
pExtension->m_bAutoInclude = pDesc->GetAttributeBool(AUTO_INCLUDE_ATTRIB);
pExtension->m_bUsesXML = pDesc->GetAttributeBool(USES_XML_ATTRIB);
// API version
CString sAPIVersion;
if (pDesc->FindAttribute(API_VERSION_ATTRIB, &sAPIVersion))
{
pExtension->m_dwAPIVersion = (DWORD)strToInt(sAPIVersion, 0);
if (pExtension->m_dwAPIVersion < 12)
pExtension->m_dwAPIVersion = 0;
pExtension->m_sVersion = pDesc->GetAttribute(VERSION_ATTRIB);
}
else if (dwInheritAPIVersion)
{
pExtension->m_dwAPIVersion = dwInheritAPIVersion;
pExtension->m_sVersion = pDesc->GetAttribute(VERSION_ATTRIB);
}
else
{
sAPIVersion = pDesc->GetAttribute(VERSION_ATTRIB);
pExtension->m_dwAPIVersion = ::LoadExtensionVersion(sAPIVersion);
}
if (pExtension->m_dwAPIVersion == 0)
{
pExtension->m_pEntities = NULL; // Let our parent clean up.
delete pExtension;
*retsError = strPatternSubst(CONSTLIT("Unable to load extension: incompatible version: %s"), sAPIVersion);
return ERR_FAIL;
}
// If this is a later version, then disabled it
if (pExtension->m_dwAPIVersion > API_VERSION)
pExtension->SetDisabled(CONSTLIT("Requires a newer version of Transcendence.exe"));
// Release
pExtension->m_dwRelease = pDesc->GetAttributeInteger(RELEASE_ATTRIB);
// Registered extensions default to release 1.
//.........这里部分代码省略.........