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.
Regards,
--PA
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
--pa
You are welcome. :)
This was extremely helpful -- thanks!