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


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

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


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

示例1: CustomizeProject

void CSDKAPWZAppWiz::CustomizeProject(IBuildProject* pProject)
{
	// TODO: Add code here to customize the project.  If you don't wish
	//  to customize project, you may remove this virtual override.
	
	// This is called immediately after the default Debug and Release
	//  configurations have been created for each platform.  You may customize
	//  existing configurations on this project by using the methods
	//  of IBuildProject and IConfiguration such as AddToolSettings,
	//  RemoveToolSettings, and AddCustomBuildStep. These are documented in
	//  the Developer Studio object model documentation.

	// WARNING!!  IBuildProject and all interfaces you can get from it are OLE
	//  COM interfaces.  You must be careful to release all new interfaces
	//  you acquire.  In accordance with the standard rules of COM, you must
	//  NOT release pProject, unless you explicitly AddRef it, since pProject
	//  is passed as an "in" parameter to this function.  See the documentation
	//  on CCustomAppWiz::CustomizeProject for more information.
	
	//The following sets the project settings for 'Addtional include directories:'
	//maxsdk/include, maxsdk/lib and 'Output file name:' 3dsmax/plugin/*.*

	CString sPath, pPath, ePath, sInc, sRC, sL, sG, pName, pExt;
	IConfigurations *pConfigs;
	long count;
	IConfiguration *pConfig;		
	CString base_address;	

	// Generate a random 64K mutliple base address
	int K64 = 64*1024;
	base_address.Format(_T("0x%x"), ((rand() + rand() + ((rand()+(rand()<<16))))/K64)*K64);
	lookup_key(_T("root"),		pName);
	lookup_key(_T("PLUGEXT"),	pExt);
	lookup_key(_T("SDKPATH"),	sPath);
	lookup_key(_T("PLGPATH"),	pPath);
	lookup_key(_T("EXEPATH"),	ePath);
	
//	pName.SetAt(0, toupper(pName[0]));

	// 3dsmax.exe and maxsdk include paths
	sInc =  "/I" + sPath + "\\include "; 

	// Linker settings
	sL = 
		//output filename
		"/out:" + pPath + "\\" + pName + "." + pExt + " " +
			
		//sdk libs
		" comctl32.lib " + GetPluginLibs(pExt) + 

		//maxsdk libpath
		" /LIBPATH:" + sPath + "\\lib " + " /DLL /base:" + base_address;

	// General Settings
	sG = CString("0");		//To specify Not Using MFC

	BSTR bszComp = CString("cl.exe").AllocSysString();
	BSTR bszLink = CString("link.exe").AllocSysString();	
	BSTR bszMfc  = CString("mfc").AllocSysString();
	
	// Compiler settings
	BSTR bszSettingsC[] = { 
		("/MDd /G6 /LD " + sInc).AllocSysString(), // Debug
		("/MD /G6 /LD "  + sInc).AllocSysString(), // Hybrid
		("/MD /G6 /LD "  + sInc).AllocSysString()  // Release
		};

	BSTR bszRemSettingsC = CString(_T("/GX /D_MBCS /GZ")).AllocSysString();
	BSTR bszHyb = CString("Hybrid").AllocSysString();
	BSTR bszSettingsL = sL.AllocSysString();
	BSTR bszSettingsG = sG.AllocSysString();
	
	COleVariant res;

	pProject->AddConfiguration(bszHyb, res);
	pProject->get_Configurations(&pConfigs);		
	pConfigs->get_Count(&count);	
	for (long i = 1; i <= count; i++)
	{
		COleVariant varInd(i);
		pConfigs->Item(varInd , &pConfig);
		
		COleVariant var(0L,VT_ERROR);
		var.scode=DISP_E_PARAMNOTFOUND;

		pConfig->AddToolSettings(bszMfc, bszSettingsG, var);		
		pConfig->AddToolSettings(bszLink, bszSettingsL, var);
		
		COleVariant varStr;

		pConfig->get_Name(&V_BSTR(&varStr));
		
		varStr.vt = VT_BSTR;

		if (varStr == COleVariant(pName + " - Win32 Debug"))
		{
			pConfig->AddToolSettings(bszComp, bszSettingsC[0], var);
			SysFreeString(bszSettingsC[0]);
		}
		else if (varStr == COleVariant(pName + " - Win32 Hybrid"))
//.........这里部分代码省略.........
开发者ID:DimondTheCat,项目名称:xray,代码行数:101,代码来源:sdkapwzaw.cpp


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