当前位置: 首页>>代码示例>>C++>>正文


C++ IApplication::get_ActiveProject方法代码示例

本文整理汇总了C++中IApplication::get_ActiveProject方法的典型用法代码示例。如果您正苦于以下问题:C++ IApplication::get_ActiveProject方法的具体用法?C++ IApplication::get_ActiveProject怎么用?C++ IApplication::get_ActiveProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IApplication的用法示例。


在下文中一共展示了IApplication::get_ActiveProject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CString

HRESULT CCommands::XApplicationEvents::BuildFinish(long nNumErrors, long nNumWarnings)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	if (nNumErrors == 0)
	{
		CComPtr<IGenericProject> pProjectItem = NULL;
		IApplication* pApplication;
		CComPtr<IConfiguration> pConfig = NULL;
		CComBSTR bsBuildName;
		CString strBuildName;

		pApplication = m_pCommands->GetApplicationObject();
		VERIFY_OK(pApplication->get_ActiveProject((IDispatch **)&pProjectItem));
		VERIFY_OK(pApplication->get_ActiveConfiguration((IDispatch **)&pConfig));
		pConfig->get_Name(&bsBuildName);
		strBuildName = bsBuildName;

		if (!pProjectItem)
		{
			return S_OK;
		}

		CComBSTR bsFullName, bsName;
		CString strProjectFullName, strProjectPath,
			strConfigName, strProjectName;
		UINT uSvnVersion = 0;

		pProjectItem->get_FullName(&bsFullName);
		pProjectItem->get_Name(&bsName);

		strProjectFullName = bsFullName;
		strProjectName = bsName;

		TCHAR sDrive[_MAX_DRIVE] = {0};
		TCHAR sDir[_MAX_DIR] = {0};
		TCHAR sFname[_MAX_FNAME] = {0};
		TCHAR sExt[_MAX_EXT] = {0};

		_tsplitpath(strProjectFullName, 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.bPdbAutoCommit &&
			-1 != config.strCommitList.Find(strBuildName + '#'))
		{
			CString strPdbPath, strOutputDir, strReg, strOutPut, strOutData, strData;
			const TCHAR sReg[] = _T("IF[ ]+\"\\$\\(CFG\\)\" == \"%s\"([^!]+)");
			const TCHAR sRegOutputDir[] = _T("^.+PROP Output_Dir[ ]+\"(.+)\"$");
			const TCHAR sRegPdbPath[] = _T("^# ADD LINK32(?:.+/pdb:\"(?<PDB>[^\"]+)\".+/debug)|(?:.+(?<PDB>/debug))");
			const TCHAR sRegOutPut[] = _T("^# ADD LINK32(?:.+/out:\"(?<OUT>[^\"]+)\")");

			strReg.Format(sReg, strBuildName);

			// Get PDB File Path
			GetFileData(strProjectFullName, strOutData);
			if (strOutData.IsEmpty())
			{
				return S_OK;
			}
			strData = GetRegexpData(strOutData, strReg, MULTILINE | IGNORECASE);
			strOutputDir = GetRegexpData(strData, sRegOutputDir, MULTILINE | IGNORECASE);
			strPdbPath = GetRegexpData(strData, sRegPdbPath, MULTILINE | IGNORECASE, "PDB");
			strOutPut = GetRegexpData(strData, sRegOutPut, MULTILINE | IGNORECASE, "OUT");
			if (strPdbPath.IsEmpty())
			{
				pApplication->PrintToOutputWindow(CComBSTR("Not Find Pdb File Path So Can't Auto Commit PDB\r\n"));
				return S_OK;
			}
			if (!strPdbPath.CompareNoCase(_T("/debug")))
			{
				if (strOutPut.IsEmpty())
				{
					strPdbPath = strOutputDir + '\\' + strProjectName + ".pdb";
				}
				else
				{
					TCHAR ssFname[_MAX_FNAME] = {0};

					_tsplitpath(strOutPut, NULL, NULL, ssFname, NULL);
					strPdbPath = strOutputDir + '\\' + ssFname + ".pdb";
				}
			}

			// Commit PDB File To Server
			MANUALBACKUP ManualBackup = {0};
			ManualBackup.dwMaxSingleFileSize = -1;
			ManualBackup.dwUserData = (DWORD)m_pCommands;
			ManualBackup.pfnCallBackProc = ManualCallBackProc;
			strcpy(ManualBackup.szExtName, "*.pdb");
			ManualBackup.pFileName = new ANSIPATH[1];
			strcpy(ManualBackup.pFileName[0], strProjectPath + strPdbPath);
			ManualBackup.uFileCount = 1;
			strcpy(ManualBackup.szServerIP, config.strPdbServer);
			strcpy(ManualBackup.szReason, _T("PDB:"));
			ManualBackupToServer(&ManualBackup);
//.........这里部分代码省略.........
开发者ID:daiybh,项目名称:UpdateVersion,代码行数:101,代码来源:Commands.cpp


注:本文中的IApplication::get_ActiveProject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。