Ah, I see. Instead of Item("DefineConstants") try to use the
ProjectConfigurationProperties.DefineConstants (don't forget to add
reference to VSLangProj):
Sub DefineConstantExample()
Dim solution As EnvDTE.Solution = DTE.Solution
For Each project As EnvDTE.Project In solution
Dim conf As EnvDTE.Configuration
For Each conf In project.ConfigurationManager
Dim p As VSLangProj.ProjectConfigurationProperties = conf.Object
p.DefineConstants = "YourConstant"
Next
Exit Sub
Next
End Sub
It sets "YourConstants" compilation constant through all projects in the
solution.
--
Sergey Bogdanov
http://www.sergeybogdanov.com
ME wrote:
> Yes, but I need to do this programatically by the use of a macro (as the
> example showed). I have several projects and would like to easily turn a
> particular constant on and off for all projects. A toolbar button
> refrencing a macro is the plan.
>
> Thanks,
>
> Matt
> "Sergey Bogdanov" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>>You can define the conditional compilation constants by calling the menu
>>item Project/Properties and then select Configuration Properties.
>>
>>--
>>Sergey Bogdanov
>>http://www.sergeybogdanov.com
>>
>>
>>ME wrote:
>>
>>>What is the alternative way of performing the code shown in the link on a
>>>Smart Device (Compact Framework) type project? The example bombs out on
>>>Smart Device projects. The object, conf.Properties, is always set to
>>>null
>>>or nothing. It works just fine on Standard Full Framework projects.
>>>http://msdn.microsoft.com/library/de...econstants.asp
>>>
>>>Thanks,
>>>
>>>Matt
>>>
>>>
>
>