PC Review


Reply
Thread Tools Rate Thread

DefineConstants Property for VS.NET 2003 Macro

 
 
ME
Guest
Posts: n/a
 
      4th Jun 2005
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



 
Reply With Quote
 
 
 
 
Sergey Bogdanov
Guest
Posts: n/a
 
      5th Jun 2005
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
>
>
>

 
Reply With Quote
 
ME
Guest
Posts: n/a
 
      6th Jun 2005
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
>>
>>


 
Reply With Quote
 
Sergey Bogdanov
Guest
Posts: n/a
 
      6th Jun 2005
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
>>>
>>>

>
>

 
Reply With Quote
 
ME
Guest
Posts: n/a
 
      6th Jun 2005
Exactly. Thanks for the input, worked like a charm.

Thanks,

Matt

"Sergey Bogdanov" <(E-Mail Removed)> wrote in message
news:%23k1%(E-Mail Removed)...
> 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
>>>>
>>>>

>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help on Excel 2003 Macro Visible Property TheGrimbler Microsoft Excel Programming 2 15th Nov 2008 04:32 PM
filter property in macro =?Utf-8?B?S2FyZW4=?= Microsoft Access Macros 1 10th Feb 2006 06:33 PM
macro that runs when the value in A1 has a certain property =?Utf-8?B?cmVkYg==?= Microsoft Excel Programming 1 27th Jan 2006 12:02 PM
Access 2003 - form property not working with 'medium' macro security =?Utf-8?B?RGVzQg==?= Microsoft Access Form Coding 1 30th Apr 2004 01:20 PM
Set Field Property using a Macro Jennifer Microsoft Access Macros 1 15th Dec 2003 06:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:01 PM.