📄 default.js
字号:
{
var nCntr;
for(nCntr = 0; nCntr < nNumConfigs; nCntr++)
{
// Check if it's Debug configuration
var bDebug = false;
if(astrConfigName[nCntr].search("Debug") != -1)
bDebug = true;
// General settings
var config = proj.Object.Configurations(astrConfigName[nCntr]);
if(wizard.FindSymbol("WTL_USE_UNICODE"))
config.CharacterSet = charSetUnicode;
else
config.CharacterSet = charSetMBCS;
if(bDebug)
{
config.IntermediateDirectory = 'Debug';
config.OutputDirectory = 'Debug';
config.ATLMinimizesCRunTimeLibraryUsage = false;
}
else
{
config.IntermediateDirectory = 'Release';
config.OutputDirectory = 'Release';
config.ATLMinimizesCRunTimeLibraryUsage = true;
}
if(wizard.FindSymbol("WTL_USE_VIEW") && wizard.FindSymbol("WTL_COMBO_VIEW_TYPE") == "WTL_VIEWTYPE_HTML")
config.UseOfATL = useATLDynamic;
// Compiler settings
var CLTool = config.Tools('VCCLCompilerTool');
CLTool.UsePrecompiledHeader = pchUseUsingSpecific;
CLTool.WarningLevel = warningLevel_3;
if(bDebug)
{
CLTool.RuntimeLibrary = rtMultiThreadedDebug;
CLTool.MinimalRebuild = true;
CLTool.DebugInformationFormat = debugEditAndContinue;
CLTool.BasicRuntimeChecks = runtimeBasicCheckAll;
CLTool.Optimization = optimizeDisabled;
}
else
{
CLTool.RuntimeLibrary = rtMultiThreaded;
CLTool.ExceptionHandling = false;
CLTool.DebugInformationFormat = debugDisabled;
}
var strDefines = GetPlatformDefine(config);
strDefines += "_WINDOWS;STRICT;";
if(bDebug)
strDefines += "_DEBUG";
else
strDefines += "NDEBUG";
CLTool.PreprocessorDefinitions = strDefines;
// Linker settings
var LinkTool = config.Tools('VCLinkerTool');
LinkTool.SubSystem = subSystemWindows;
LinkTool.TargetMachine = machineX86;
if(bDebug)
{
LinkTool.LinkIncremental = linkIncrementalYes;
LinkTool.GenerateDebugInformation = true;
}
else
{
LinkTool.LinkIncremental = linkIncrementalNo;
}
// Resource settings
var RCTool = config.Tools("VCResourceCompilerTool");
RCTool.Culture = rcEnglishUS;
RCTool.AdditionalIncludeDirectories = "$(IntDir)";
if(bDebug)
RCTool.PreprocessorDefinitions = "_DEBUG";
else
RCTool.PreprocessorDefinitions = "NDEBUG";
// MIDL settings
var MidlTool = config.Tools("VCMidlTool");
MidlTool.MkTypLibCompatible = false;
if(IsPlatformWin32(config))
MidlTool.TargetEnvironment = midlTargetWin32;
if(bDebug)
MidlTool.PreprocessorDefinitions = "_DEBUG";
else
MidlTool.PreprocessorDefinitions = "NDEBUG";
MidlTool.HeaderFileName = strProjectName + ".h";
MidlTool.InterfaceIdentifierFileName = strProjectName + "_i.c";
MidlTool.ProxyFileName = strProjectName + "_p.c";
MidlTool.GenerateStublessProxies = true;
MidlTool.TypeLibraryName = "$(IntDir)/" + strProjectName + ".tlb";
MidlTool.DLLDataFileName = "";
// Post-build settings
if(wizard.FindSymbol('WTL_COM_SERVER'))
{
var PostBuildTool = config.Tools("VCPostBuildEventTool");
PostBuildTool.Description = "Performing registration...";
PostBuildTool.CommandLine = "\"$(TargetPath)\" /RegServer";
}
}
}
catch(e)
{
throw e;
}
}
function AddPchSettings(proj)
{
try
{
var files = proj.Object.Files;
var fStdafx = files("StdAfx.cpp");
var nCntr;
for(nCntr = 0; nCntr < nNumConfigs; nCntr++)
{
var config = fStdafx.FileConfigurations(astrConfigName[nCntr]);
config.Tool.UsePrecompiledHeader = pchCreateUsingSpecific;
}
}
catch(e)
{
throw e;
}
}
function DelFile(fso, strWizTempFile)
{
try
{
if (fso.FileExists(strWizTempFile))
{
var tmpFile = fso.GetFile(strWizTempFile);
tmpFile.Delete();
}
}
catch(e)
{
throw e;
}
}
function CreateCustomInfFile()
{
try
{
var fso, TemplatesFolder, TemplateFiles, strTemplate;
fso = new ActiveXObject('Scripting.FileSystemObject');
var TemporaryFolder = 2;
var tfolder = fso.GetSpecialFolder(TemporaryFolder);
var strWizTempFile = tfolder.Path + "\\" + fso.GetTempName();
var strTemplatePath = wizard.FindSymbol('TEMPLATES_PATH');
var strInfFile = strTemplatePath + '\\Templates.inf';
wizard.RenderTemplate(strInfFile, strWizTempFile);
var WizTempFile = fso.GetFile(strWizTempFile);
return WizTempFile;
}
catch(e)
{
throw e;
}
}
function GetTargetName(strName, strProjectName)
{
try
{
var strTarget = strName;
var strResPath = "res\\";
if(strName.substr(0, 4) == "root")
{
var nNameLen = strName.length;
if(strName == "root.ico" || strName == "rootDoc.ico" || strName == "root.exe.manifest")
{
strTarget = strResPath + strProjectName + strName.substr(4, nNameLen - 4);
}
else
{
strTarget = strProjectName + strName.substr(4, nNameLen - 4);
}
}
else if(strName == 'frame.h')
{
strTarget = 'MainFrm.h';
}
else if(strName == 'frame.cpp')
{
strTarget = 'MainFrm.cpp';
}
else if(strName == 'view.h')
{
strTarget = strProjectName + 'View.h';
}
else if(strName == 'view.cpp')
{
strTarget = strProjectName + 'View.cpp';
}
else if(strName == 'toolbar.bmp')
{
strTarget = strResPath + strName;
}
return strTarget;
}
catch(e)
{
throw e;
}
}
function AddFilesToCustomProj(proj, strProjectName, strProjectPath, InfFile)
{
try
{
var projItems = proj.ProjectItems
var strTemplatePath = wizard.FindSymbol('TEMPLATES_PATH');
var strTpl = '';
var strName = '';
var strTextStream = InfFile.OpenAsTextStream(1, -2);
while (!strTextStream.AtEndOfStream)
{
strTpl = strTextStream.ReadLine();
if (strTpl != '')
{
strName = strTpl;
var strTarget = GetTargetName(strName, strProjectName);
var strTemplate = strTemplatePath + '\\' + strTpl;
var strFile = strProjectPath + '\\' + strTarget;
var bCopyOnly = false; //"true" will only copy the file from strTemplate to strTarget without rendering/adding to the project
var strExt = strName.substr(strName.lastIndexOf("."));
if(strExt==".bmp" || strExt==".ico" || strExt==".gif" || strExt==".rtf" || strExt==".css")
bCopyOnly = true;
wizard.RenderTemplate(strTemplate, strFile, bCopyOnly);
// don't add these files to the project
if(strTarget == strProjectName + ".h" ||
strTarget == strProjectName + "ps.mk" ||
strTarget == strProjectName + "ps.def")
continue;
proj.Object.AddFile(strFile);
}
}
strTextStream.Close();
}
catch(e)
{
throw e;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -