⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 buildcount.dsm

📁 功能强大的代理服务器
💻 DSM
字号:
'------------------------------------------------------------------------------'FILE DESCRIPTION: Automatically increment the version resource information of the project after each build'------------------------------------------------------------------------------Function GetProjectDir(FullName)'VC++ doesn't provide any method for getting the path of the active project'See the VB Script reference for more information on the VB Script functions 'used in this functionDim proj_pathproj_path = Split(StrReverse(FullName),"\",-1,1)Dim countcount = UBound(proj_path)Dim full_pathfull_path = ""Dim ifor i = 1 to count 	full_path = full_path & "\" & proj_path(i)nextGetProjectDir = StrReverse(full_path)End FunctionSub ReplaceText(selection, count, incrementby)'selection represents the TextSelection object'count represents the position of the version number to be incremented'incrementby represents a number that will be added to the existing version numberselection.WordRight dsMove, countselection.WordRight dsExtend, 1Dim strstr = selection.Textstr = str + incrementbyselection.Text = strEnd SubSub Application_BuildFinish(numError, numWarning)'This event will be triggered after every build of a project'You can check numError and/or numWarning to determine if you want to continue'If numError <> 0 Then    'exit sub'Obtain the full path of the active projectDim full_pathfull_path = GetProjectDir(ActiveProject.FullName)full_path = full_path & "buildver.h"'Open the VersionNo.h fileon error resume nextDocuments.Open full_path'Obtain the TextSelection objectDim selectionset selection = ActiveDocument.Selectionselection.StartOfDocument 'Increment the version informationReplaceText selection, 9, 1selection.LineDownselection.StartOfLineReplaceText selection, 9, 1selection.LineDownselection.StartOfLineReplaceText selection, 10, 1selection.LineDownselection.StartOfLineReplaceText selection, 10, 1ActiveDocument.SaveActiveDocument.Close End Sub 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -