VISUAL STUDIO, MFC PROJECT - visual-studio-2010

I am running a third party sample MFC project:
In the "Output" tab of a successful build, this is shown:
1> MDIBars.vcxproj -> C:\Program Files (x86)\BCGSoft\BCGControlBarPro\Samples\MDIBars - Copy'\'.'\'..\Bin\MDIBarsD.exe
(I had to add two pairs of ' to get it to post correctly)
What does this mean? Specifically, the ".\" & "..\"
I know that .\ is the directory the .sln is in...
I know that ..\ means one up from where the directory the .sln is in...
The directory just before the .\ is the location of the .sln. So it appears there are identical consecutive directories in the file path? It looks recursive.
What am I missing?
The MDIBars Property Pages/Config Properties/Debugging/working directory is C:\Program Files (x86)\BCGSoft\BCGControlBarPro\Bin <\n new line>
The MSVS2013 solution file is here: C:\Program Files (x86)\BCGSoft\BCGControlBarPro\Samples\MDIBars - Copy<\n to make this post clear>
The solution file is called MDIBars.sln
ProjectDir: C:\Program Files (x86)\BCGSoft\BCGControlBarPro\Samples\MDIBars - Copy
Notice they do not have the MDIBars Property Pages/Config Properties/Debugging/working directory where the project .sln file is located.
Any help is appreciated...Thanks,

that is just an artefact of concatenating paths automatically.
. means "current directory", .., as you noted, means "one level up".
c:\xyz\.\abc is the same as c:\xyz\abc and c:\xyz\..\abc reduces to c:\abc (think of it as going to xyz, then one level up and to abc)

Related

Visual studio 2015 tfs add files to source control

I have the following issue-
On Team Explorer - Pending Changes there is an option that automatically detects added files to folders that are under source control. The problem is that more than 50,000 files are detected.
Is there any way to edit this list? to remove items I don't care about so it will be relevant when I do have files I want to add?
(I know I can add items in the Source Control but I want to make this option usable)
You can click the 'Detected' link to pop up the "Promote Candidate Changes" dialog, then select the files you want to check in to promote.
If you're using local workspaces, you can add a .tfignore file to ignore the files which you don't want to be detected in source control. eg: ignore by file extension .txt, then all the .txt files will be ignored in source control. They will not be detected.
Please see Customize which files are ignored by version control for details.
Please note that with TFVC you need to put .tfignore in every solution root.
.tfignore file rules The following rules apply to a .tfignore file:
# begins a comment line
The * and ? wildcards are supported.
A filespec is recursive unless prefixed by the \ character.
! negates a filespec (files that match the pattern are not ignored)
.tfignore file example
######################################
# Ignore .cpp files in the ProjA sub-folder and all its subfolders
ProjA\*.cpp
#
# Ignore .txt files in this folder
\*.txt
#
# Ignore .xml files in this folder and all its sub-folders
*.xml
#
# Ignore all files in the Temp sub-folder
\Temp
#
# Do not ignore .dll files in this folder nor in any of its sub-folders
!*.dll

How do I get PyCharm File Watcher to maintain my directory structure for SCSS output

I am currently working on getting automatic SCSS -> CSS conversion set up using PyCharm's File Watcher functionality. I am able to have the files output to another directory, but I cannot get them to do it relative to a specific directory. Currently, I have the following settings and relevant file tree:
Tree
|media/
|-c/
| |-css/
| |-folder/
| | |-file2.css
| --file.css
--src/
|-css/
|-folder/
| |-file2.scss
--file.scss
File Watcher Settings
Scope is the media/src/css/ directory and all subdirectories recursively
Arguments is --no-cache --update $FileName$:$ProjectFileDir$/media/c/$FileDirRelativeToProjectRoot$/$FileNameWithoutExtension$.css
Working directory is $ProjectFileDir$/media/src/css/
Output paths to refresh is $ProjectFileDir$/media/c/$FileDirRelativeToProjectRoot$/$FileNameWithoutExtension$.css
With these settings, when I update file2.scss, there is an error stating that media/c/media/src/css/folder does not exist, which is not where I want the file anyway.
The issue that I am having is that I would like to have all paths relative to the working directory root preserved (ie. media/src/css/folder -> media/c/css/folder, but all of my source SCSS files are under multiple folder levels from the project root and the tutorial only specifies how to maintain folder structure if you are compiling directly below the root, not a folder below the root. Does anyone know a way that my folder structure could be preserved so that anything under media/src/css would have the same relative output in media/c/css?
The CrazyCoder posted solution in another Question. It is hard to find, so I'm linking it. https://stackoverflow.com/a/15965088/2047157
Quoting:
The trick is to use $FileDirPathFromParent(dir)$ macro:

Can Visual Studio read a set of include file paths from a text file for the Additional Include Directories?

I'm trying to figure out how to get Visual Studio to read a set of include files from a text file.
For example, I would like to create a text file called IncludePaths.txt that contains a list of include paths such as "/I ../../header"
I would then tell Visual Studio reference this file.
I believe you could do this by adding #IncludePaths.txt to the Additional Include Directory, but I cannot get this to work. I have seen this done in projects I have worked on in the past but I can't find any documentation or figure out the trick.
After a little more research and talking to a couple of other developers, I figured out the "trick"
1) Create a file called IncludePaths.txt next to my project file.
2) Add your include paths to this file...
/I "..\..\..\..\open\common\include"
/I "..\..\..\common\include"
/I "..\..\"
3) Go to Properties -> C++ -> Command Line
4) Under "Additional Options" add #IncludePaths.txt
Alternatively, you can use custom properties to get this to work too.

How to specify relative paths in .vsprops file

Is there any way to specify in .vsprops file paths relative to .vsprops file directory?
For example, I have the followind directory stucture:
largesolution.sln
a/a.vcproj
b/c/c.vcproj
common/common.vsprops
Both a.vcproj and c.vcproj include common.vsprops, and I want to add some macro or set include directory relative to common folder regardless the solution directory both projects are included to. I've tried using $(InputDir) in .vsprops file, but it seems this macro is expanded as directory containing .vcproj, not .vsprops file.
Setting absolute paths or setting global include path in Visual C++ Directories is not a solution because different developers have different location of the source tree root. Setting paths relative to $(SolutionDir) does not suit because it is useful to have smaller solutions containig some subset ob projects (for example, a.vcproj only) somewhere outside main sources tree.
Of course, setting include directory in a.vcproj to $(ProjectDir)..\common works fine, but the result to be achieved is only including .vsprops and having paths set correctly.
You can use MSBuildThisFileDirectory macro.
For example:
You set Include Directories to "$(MSBuildThisFileDirectory)\include;$(IncludePath)" in common.props.
See http://msdn.microsoft.com/en-us/library/vstudio/ms164309.aspx for details.
Tested with MSVS2012 and MSVS2013.

User VisualStudio PostBuild with place-marker

After successfully build, I want to copy the content of the the folder to the destination.
I've learned that this will work fine:
copy "$(TargetPath)" "$(TargetDir)\..\..\..\TB-Annotation Editor\bin\Debug\Plugins\$(TargetFileName)"
But I am interested to copy all *.exe, all *.dll and all *.txt files into the destination and this could cost a lot of lines for each plugin. Now I wanted to ask if there is any possibility to use place-marker instead of fixed filenames.
this does not work and raise event "Error Code 1"
copy "$(TargetDir)*.*" "$(SolutionDir)bin\Debug\plugins\"
Regards
** Solved except .dll *
I'm very sorry, seems to be not an error because of the "*" but of the folder which is called same twice:
copy "$(TargetDir)*.*" "$(SolutionDir)MyProject\bin\Debug\plugins\"
Goes correct to:
"copy
"C:\Daten Laptop\PAG\Net\MyProject\Solution\Plugins\DSP - Alphablend\bin\Debug\DSP - Alphablend.exe"
"C:\Daten Laptop\PAG\Net\MyProject\Solution\MyProject Main\MyProject Main\bin\Debug\plugins\DSP - Alphablend.exe""
But when using ".dll" instead of ".*" (DLL does not exist, because at the moment it is selected as *.exe) it does throw error code 1 again.
To my mind the best way of doing this is setting file properties and project properties. This requires no additional lines at all. If you set "output folder" property for project, "copy local" flags for referenced libraries and change "Build action" and "Copy to output directory" properties for your txt files (they should be included to solution) you get what you want.

Resources