⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compliervcnetcl.cpp

📁 自动化编译工具代码
💻 CPP
字号:
// ComplierVCNETCL.cpp: implementation of the CComplierVCNETCL class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ComplierVCNETCL.h"

#include "regkey.h"
#include "Common.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CComplierVCNETCL::CComplierVCNETCL(NetVersion version)
{
	CString strNETVersion;
	if		(NET2002 == version) strNETVersion = "7.0";
	else if	(NET2003 == version) strNETVersion = "7.1";
	else if	(NET2005 == version) strNETVersion = "8.0";
	else                         ASSERT(FALSE);

	const CString strRegPath = "SOFTWARE\\Microsoft\\VisualStudio\\"+strNETVersion;
	CRegKey reg;
	if (ERROR_SUCCESS == reg.Open(HKEY_LOCAL_MACHINE, strRegPath))
	{
		reg.Read("InstallDir", m_strDEVNVPath);
		if (!m_strDEVNVPath.IsEmpty())
		{
			m_strDEVNVPath += "devenv.com";
		}
	}
}

CComplierVCNETCL::~CComplierVCNETCL()
{

}


BOOL CComplierVCNETCL::Build(const CString &strProjectFile,
							 const CString &strConfigName, 
							 const CString &strOutputFile)
{
	ASSERT(!strProjectFile.IsEmpty());
	ASSERT(!strConfigName.IsEmpty());

	CString strParameters;
	strParameters.Format("%s /REBUILD %s /OUT %s"
							,strProjectFile
							,strConfigName
							,G_strBuildLog);

	CCommon::WinExecAndWait32(m_strDEVNVPath, strParameters, CCommon::GetFilePath(strProjectFile));	


	return CCommon::BuildProjectSuccessed(CCommon::GetFilePath(strProjectFile) + G_strBuildLog);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -