在自定义向导C ++ Visual Studio 2010中添加道具文件 [英] Add a props file in Custom Wizard C++ Visual Studio 2010

查看:82
本文介绍了在自定义向导C ++ Visual Studio 2010中添加道具文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在尝试创建项目模板,这样我就不必通过所有设置来创建新项目。但我正在试图弄清楚如何添加我生成的道具文件。这些文件概述了我需要在所有项目中保持一致的一些设置。



在default.js脚本中,我试图了解如何将prop文件添加到生成的项目中。我知道我必须在default.js文件中的AddConfig函数中做一些事情,但我不知道要调用什么函数来加载已经存在的props文件。我尝试添加AddPropertySheet但是当我尝试基于这个向导创建一个新项目时它只是崩溃VS2010。



我使用属性管理器生成了props文件。 />


非常感谢任何帮助。



Hi

I am trying to create a project template so that I do not have to go through all of the settings to create new projects. But I am hitting a brick wall trying to figure out how to add props files that I have generated. These files outline a few settings that I need consistent in all my projects.

In the default.js script I am trying to understand how to get the prop file to be added into the generated project. I know I have to do something probably in AddConfig function in the default.js file, but I have no idea what function to call to load already pre-existing props file. I tried adding AddPropertySheet but it just crashes the VS2010 when I try to create a new project based on this wizard.

I generated the props file using property manager.

Any help would be greatly appreciated.

function AddConfig(proj, strProjectName)
{
	try
	{
	    var config = proj.Object.Configurations('Debug');
                
            //THIS CAUSES A CRASH
            config.AddPropertySheet( 'C:\default.props');

		var CLTool = config.Tools('VCCLCompilerTool');
		// TODO: Add compiler settings
		CLTool.PreprocessorDefinitions = 'WIN32;_DEBUG;_CONSOLE';

		var LinkTool = config.Tools('VCLinkerTool');
		// TODO: Add linker settings

		config = proj.Object.Configurations('Release');


		var CLTool = config.Tools('VCCLCompilerTool');
		CLTool.PreprocessorDefinitions = 'WIN32;NDEBUG;_CONSOLE';
		// TODO: Add compiler settings

		var LinkTool = config.Tools('VCLinkerTool');
		// TODO: Add linker settings
	}
	catch(e)
	{
		throw e;
	}
}

推荐答案

参见 Visual C ++ Express,自定义向导 [ ^ ],这可能对您有帮助。
See Visual C++ Express, Custom Wizard[^], which may help you.


这篇关于在自定义向导C ++ Visual Studio 2010中添加道具文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆