Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing the Macros for build commands

1 view
Skip to first unread message

raddog58c

unread,
Aug 25, 2008, 1:43:31 PM8/25/08
to
I'm sure this is a very simple question, but after 30 minutes of
perusing hyperlinks I'm convinced finding the answer is not simple.

There are a set of macros defined in Visual Studio C++ .NET. Here's
some examples:

${SolutionDir}

${ConfigurationName}

${ProjectName}

etc.

Two questions:

1. How can I display the current contents of each of these macros?

2. How can I change them to the values I want them to be?

For instance, Visual Studio is rooting my projects in:

C:\Documents and Settings\user\My Documents\Visual Studio Projects

I want them rooted in:

C:\MSDev

Using macros is fine by me, but can't they be made a little easier to
find and update? My objective is writing, compiling and debugging
code, and the documentation on how to change these is not intuitive
nor readily accessible.

Pavel A.

unread,
Aug 26, 2008, 2:23:16 AM8/26/08
to
Look for "Project Property pages" and "Property sheets" in VC help.
These macros can be defined thru the property pages.
Open "property manager" to view existing prop. pages and their macros.
(cudos go to Alex Blechman for the info)

Regards,
--PA

Alex Blekhman

unread,
Aug 26, 2008, 4:01:11 AM8/26/08
to
"raddog58c" wrote:
> 1. How can I display the current contents of each of these
> macros?

You just open project properties dialog and go to any editable
field that contains macros. Usually a drop-down button [V] or an
edit button [...] appears the moment you put a focus into the
field. Click on the button and select <Edit...> item in drop-down
list. The edit dialog will pop up. On this dialog bellow edit box,
where a value of the field goes, there is a [Macros >>] button.
Press this button and you will see the full list of currently
defined macros and their values.

For example, in "General" category (in the tree on the left pane)
there is a field "Output Directory", which default value is
"$(SolutionDir)$(ConfigurationName)". Press on drop-down button
and select <Edit...>.

> 2. How can I change them to the values I want them to be?

It depends on the macro. Some of them you cannot change, since IDE
sets up these for you. However, many of macros are derivatives of
other macros. So, by changing a "root" macro you will change all
dependant macros, as well.

For example, you cannot change $(SolutionDir) or
$(ConfigurationName) macros because they are defined for each
project by the IDE on load.

> For instance, Visual Studio is rooting my projects in:
>
> C:\Documents and Settings\user\My Documents\Visual Studio
> Projects
>
> I want them rooted in:
>
> C:\MSDev

This is easy. Go to menu Tools -> Options, then select "Projects
and Solutions" category. On the roght pane you will see default
locations for projects.

> Using macros is fine by me, but can't they be made a little
> easier to find and update?

As Pavel already wrote, if you need additional macro for your
project, then you can always add new property sheet for a project
and define there user macros. Again, you cannot change many
predefined macros, but you can change IDE/project settings that
affect predefined macros.

HTH
Alex


Pavel A.

unread,
Aug 26, 2008, 1:19:46 PM8/26/08
to
Alex, thank you again and sorry for the typo

--pa

Alex Blekhman

unread,
Aug 26, 2008, 2:35:40 PM8/26/08
to
"Pavel A." wrote:
> Alex, thank you again and sorry for the typo
>

You are welcome. :)


raddog58c

unread,
Aug 29, 2008, 1:29:26 PM8/29/08
to

This was extremely helpful -- thanks!

Message has been deleted
0 new messages