本文整理汇总了C++中IApplication::get_Projects方法的典型用法代码示例。如果您正苦于以下问题:C++ IApplication::get_Projects方法的具体用法?C++ IApplication::get_Projects怎么用?C++ IApplication::get_Projects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IApplication
的用法示例。
在下文中一共展示了IApplication::get_Projects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CString
HRESULT CCommands::XApplicationEvents::BeforeBuildStart()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
IApplication* pApplication;
pApplication = m_pCommands->GetApplicationObject();
CComPtr<IProjects> pIProjects = NULL;
pApplication->get_Projects((IDispatch **)&pIProjects);
long lProjects = 0;
CComVariant varProject ;
VERIFY_OK( pIProjects->get_Count( &lProjects ) );
for ( long lProject = 1 ; lProject < lProjects + 1 ; lProject++ )
{
varProject = lProject;
CComPtr< IGenericProject > pIGenericProject;
VERIFY_OK( pIProjects->Item(varProject, &pIGenericProject));
if (pIGenericProject)
{
CComBSTR bType;
CString strType;
pIGenericProject->get_Type(&bType);
strType = bType;
if (strType.CompareNoCase(DS_BUILD_PROJECT) != 0) continue;
CComBSTR bStr;
pIGenericProject->get_FullName(&bStr);
CString strProjectName = bStr;
CString strProjectPath, strRcName, strConfigName;
UINT uSvnVersion = 0;
TCHAR sDrive[_MAX_DRIVE] = {0};
TCHAR sDir[_MAX_DIR] = {0};
TCHAR sFname[_MAX_FNAME] = {0};
TCHAR sExt[_MAX_EXT] = {0};
_tsplitpath(strProjectName, sDrive, sDir, sFname, sExt);
strProjectPath = CString(sDrive) + CString(sDir);
strConfigName = CString(sDrive) + CString(sDir) + CString(sFname) + CString(_T(".ini"));
// 得到配置信息
CONFIG config;
COptionDlg::GetConfig(config, strConfigName);
if (config.bCheckSvn && !config.bCheckSelfUpdata)
{
// const svn_version_t *ver = svn_wc_version();
uSvnVersion = GetWorkSvnVersion(strProjectPath, config.iSvnVersionPath);
if (uSvnVersion == 0)
{
return S_OK;
}
}
CString Data;
GetFileData(strProjectName, Data);
if (Data.IsEmpty())
{
return S_OK;
}
strRcName = GetRegexpData(Data, _T("SOURCE=(?<SCR>.+\\.rc)$|SOURCE=\"(?<SCR>.+\\.rc)\""), MULTILINE | IGNORECASE, "SCR");
if (strRcName.IsEmpty())
{
return S_OK;
}
CString strFileVersion, strFileVersionDescribe, strVersion, strVersionDescribe, RcData;
UINT uFileVer[4], uFileVerDesc[4];
BOOL bUpdata = FALSE;
GetFileData(strProjectPath + strRcName, RcData);
if (RcData.IsEmpty())
{
return S_OK;
}
// 进行 版本信息 更新
strVersion = GetRegexpData(RcData, _T(".+VALUE.+\"FileVersion\",.+\"(.+)\""), MULTILINE | IGNORECASE);
if (!strVersion.IsEmpty())
{
sscanf(strVersion, "%d, %d, %d, %d", &uFileVer[0], &uFileVer[1], &uFileVer[2], &uFileVer[3]);
UpdataVersionInfo(uFileVer, config, uSvnVersion);
strFileVersion.Format(_T("$1%d, %d, %d, %d\\0$2"),
uFileVer[0], uFileVer[1], uFileVer[2], uFileVer[3]);
if (-1 == strFileVersion.Find(strVersion))
//.........这里部分代码省略.........