솔루션 내에서 많은 양의 프로젝트 (~ 80)를 수정하려면 일부 VS2005 IDE 매크로를 사용하고 있습니다. 설정하려는 속성 중 일부는 프로그래밍 인터페이스를 '기본'으로 표시하지만 다른 대부분의 인터페이스는 프로그래밍 인터페이스를 제공하지 않습니다. 이러한 속성을 기본값으로 설정하는 일반적인 방법이 있습니까? 어떤 임의의 속성을 설정,VCProject 속성을 기본값으로 설정
간단한 예를 (결국 된 .vcproj 파일에서이를 삭제하는 의미) :
Sub SetSomeProps()
Dim prj As VCProject
Dim cfg As VCConfiguration
Dim toolCompiler As VCCLCompilerTool
Dim toolLinker As VCLinkerTool
Dim EnvPrj As EnvDTE.Project
For Each EnvPrj In DTE.Solution.Projects
prj = EnvPrj.Object
cfg = prj.Configurations.Item(1)
toolLinker = cfg.Tools("VCLinkerTool")
If toolLinker IsNot Nothing Then
' Some tool props that expose a *default* interface'
toolLinker.EnableCOMDATFolding = optFoldingType.optFoldingDefault
toolLinker.OptimizeReferences = optRefType.optReferencesDefault
toolLinker.OptimizeForWindows98 = optWin98Type.optWin98Default
End If
toolCompiler = cfg.Tools("VCCLCompilerTool")
If toolCompiler IsNot Nothing Then
' How to set it to default? (*erase* the property from the .vcproj)'
toolCompiler.CallingConvention = callingConventionOption.callConventionCDecl
toolCompiler.WholeProgramOptimization = False
toolCompiler.Detect64BitPortabilityProblems = False
End If
Next
End Sub
어떤 조언을 주시면 감사하겠습니다.
VS2010의 경우 [이 포럼 게시물] (http://social.msdn.microsoft.com/Forums/en-IE/vsx/thread/8dff2053-432f-4bdd-b668-3c88960e1409)은 도구 개체를 새 [IVCRulePropertyStorage] (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.vcprojectengine.ivcrulepropertystorage.aspx) 인터페이스에 추가 한 다음 DeleteProperty 메서드를 사용하여 해당 속성을 제거하십시오. 그래도 나 자신을 시험해 볼 수 없었다. –