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


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

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


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

示例1: CustomizeProject


//.........这里部分代码省略.........
		"/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"))
		{
			pConfig->AddToolSettings(bszComp, bszSettingsC[1], var);
			SysFreeString(bszSettingsC[1]);
		}
		else // release
		{
			pConfig->AddToolSettings(bszComp, bszSettingsC[2], var);
			SysFreeString(bszSettingsC[2]);

			// For release config add "/release" flag to linker settings
			BSTR rel = CString(_T("/release")).AllocSysString();
			pConfig->AddToolSettings(bszLink, rel, var);
			SysFreeString(rel);
		}
		pConfig->RemoveToolSettings(bszComp, bszRemSettingsC, var);		
		pConfig->Release();
	}
	SysFreeString(bszComp);
	SysFreeString(bszLink);
	SysFreeString(bszMfc);	
	SysFreeString(bszRemSettingsC);
	SysFreeString(bszHyb);
	SysFreeString(bszSettingsL);
	SysFreeString(bszSettingsG);	
	pConfigs->Release();

#if (1)
	//The following opens the Root.cpp document in the DevStudio
	IApplication *pApp;
	IDocuments *pDocs;
	IDocuments *pDoc;
	BSTR bszRoot = (pName + CString(_T(".cpp"))).AllocSysString();
	COleVariant varOpenAs(CString(_T("Text")));
	COleVariant varReadOnly(0L, VT_BOOL);

	pProject->get_Application((IDispatch **)&pApp);
	pApp->get_Documents((IDispatch **)&pDocs);
	pDocs->Open(bszRoot, varOpenAs, varReadOnly, (IDispatch **)&pDoc);
	
	SysFreeString(bszRoot);
	pApp->Release();
	pDocs->Release();
	pDoc->Release();
#endif
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:101,代码来源:sdkapwzaw.cpp


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