本文整理汇总了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);
//.........这里部分代码省略.........