VS2008下改变项目的默认属性
来源:互联网 发布:linux下安装nginx 编辑:程序博客网 时间:2024/06/13 09:50
一直困拢我很久的一个问题,今天终于解决了。
就是VS2008建WIN32项目的时候,字符集系统默认设成UNICODE,每次都得手动修改过来,比较繁琐。程序员不就是尽量寻找能偷懒的方法吗?于是上网到处找,百度的找不到,我就去GOOGLE找。
这里给出解决方法:
找到
D:\Program Files\Microsoft Visual Studio 9.0\VC\VCWizards\AppWiz\Generic\Application\scripts\2052\default.js
在文件里面找到如下内容:
function AddSpecificConfig(proj, strProjectName, bEmptyProject, strAppType) { try { var bMFC = wizard.FindSymbol("SUPPORT_MFC"); var bATL = wizard.FindSymbol("SUPPORT_ATL"); var config = proj.Object.Configurations("Debug"); config.CharacterSet = charSetMBCS; //这里原来是charSetUnicode if (strAppType == "LIB") config.ConfigurationType = typeStaticLibrary; else if (strAppType == "DLL") config.ConfigurationType = typeDynamicLibrary; var CLTool = config.Tools("VCCLCompilerTool"); // CLTool.PrecompiledHeaderFile = "$(OutDir)/" + strProjectName + ".pch"; CLTool.RuntimeLibrary = rtMultiThreadedDebugDLL; var strDefines = CLTool.PreprocessorDefinitions; if (strDefines != "") strDefines += ";"; strDefines += GetPlatformDefine(config); strDefines += "_DEBUG"; switch(strAppType) { case "CONSOLE": strDefines += ";_CONSOLE"; if (bMFC) config.UseOfMFC = useMfcDynamic; if (bATL) config.UseOfATL = useATLStatic; break; case "LIB": strDefines += ";_LIB"; if (bMFC) config.UseOfMFC = useMfcDynamic; break; case "DLL": strDefines += ";_WINDOWS;_USRDLL;"; var strExports = wizard.FindSymbol("UPPER_CASE_SAFE_PROJECT_IDENTIFIER_NAME") + "_EXPORTS"; strDefines += strExports; if (bMFC) config.UseOfMFC = useMfcDynamic; if (bATL) config.UseOfATL = useATLStatic; break; case "WIN": strDefines += ";_WINDOWS"; if (bMFC) config.UseOfMFC = useMfcDynamic; if (bATL) config.UseOfATL = useATLStatic; break; default: break; } CLTool.PreprocessorDefinitions = strDefines; if (bEmptyProject) CLTool.UsePrecompiledHeader = pchNone; CLTool.DebugInformationFormat = debugEditAndContinue; if (strAppType != "LIB") { var LinkTool = config.Tools("VCLinkerTool"); LinkTool.GenerateDebugInformation = true; LinkTool.LinkIncremental = linkIncrementalYes; if (strAppType == "DLL" || strAppType == "WIN") LinkTool.SubSystem = subSystemWindows; else LinkTool.SubSystem = subSystemConsole; } config = proj.Object.Configurations.Item("Release"); config.CharacterSet = charSetMBCS; //这里原来是charSetUnicode if (strAppType == "LIB") config.ConfigurationType = typeStaticLibrary; else if (strAppType == "DLL") config.ConfigurationType = typeDynamicLibrary; var CLTool = config.Tools("VCCLCompilerTool"); CLTool.RuntimeLibrary = rtMultiThreadedDLL; var strDefines = CLTool.PreprocessorDefinitions; if (strDefines != "") strDefines += ";"; strDefines += GetPlatformDefine(config); strDefines += "NDEBUG"; if (bEmptyProject) CLTool.UsePrecompiledHeader = pchNone; CLTool.DebugInformationFormat = debugEnabled; switch(strAppType) { case "CONSOLE": strDefines += ";_CONSOLE"; if (bMFC) config.UseOfMFC = useMfcDynamic; if (bATL) config.UseOfATL = useATLStatic; break; case "LIB": strDefines += ";_LIB"; if (bMFC) config.UseOfMFC = useMfcDynamic; break; case "DLL": strDefines += ";_WINDOWS;_USRDLL;"; var strExports = wizard.FindSymbol("UPPER_CASE_SAFE_PROJECT_IDENTIFIER_NAME") + "_EXPORTS"; strDefines += strExports; break; case "WIN": strDefines += ";_WINDOWS"; if (bMFC) config.UseOfMFC = useMfcDynamic; if (bATL) config.UseOfATL = useATLStatic; break; default: break; } CLTool.PreprocessorDefinitions = strDefines; if (strAppType != "LIB") { var LinkTool = config.Tools("VCLinkerTool"); LinkTool.GenerateDebugInformation = true; LinkTool.LinkIncremental = linkIncrementalNo; if (strAppType == "DLL" || strAppType == "WIN") LinkTool.SubSystem = subSystemWindows; else LinkTool.SubSystem = subSystemConsole; } } catch(e) { throw e; } }
- VS2008下改变项目的默认属性
- VS2008项目属性的部分解释
- linux下,改变默认的jdk版本
- 修改VS2010、VS2008等项目的默认浏览器设置
- 修改VS2010、VS2008等项目的默认浏览器设置
- VS2010、VS2008等项目的默认浏览器修改方法
- VS2008下改变radio控件字体颜色存在的问题
- 关于VS2008下MFC中控件字体的改变
- 改变maven项目默认jdk
- 一招改变maven项目默认的编译级别
- VS2008 项目属性没有“添加 WEB 引用”的解决办法
- 我的VS2008怎么了,居然打不开项目属性窗口?
- 改变VS2008 vc项目的输出文件及中间文件到系统的临时文件夹[原]
- 修改 VS2010 项目属性的默认包含路径
- 修改 VS2010 项目属性的默认包含路径
- VS2010 项目属性的默认包含路径设置方法
- 修改 VS2010 项目属性的默认包含路径
- VS2010 项目属性的默认包含路径设置方法
- rtp-rtcp定义的结构
- java设计模式——建造者模式
- 手机端联网,电脑端借助手机端网络上网
- 绘制线条
- UI线程消息处理过程
- VS2008下改变项目的默认属性
- Ubuntu 11.10 时间设置
- lwIP相关TCP/IP应用函数
- 2013买房靠不靠谱?---“秒杀”三件最蛋疼的房事儿是关键
- 基于WiEngine游戏引擎的Sample
- SWOT分析法/KPI/SMART原则/STAR原则/6W1H原则
- Cocos2d-x调用Java
- contest: Codeforces Round #161 (Div. 2), problem: (D) Cycle in Graph 图论
- 【黑马程序员】- 面向对象的基本概念