Is the option to create a Workspace available in Microsoft Visual C++ Express? - c++

I'm new in C++ and its IDE. I'm learning it from a guide that indicates me it would be better to have a workspace where I could save projects in it. I would like to know if this option still exists or maybe is not available in Visual C++ Express. If not appearing, which other method would be suitable?

Not in the sense of Eclipse workspaces no. Visual Studio deals with a solution (and only one at a time), which is a set of projects grouped together.
If I recall correctly, the Express versions only allow one project at a time.

Visual Studio 6 and earlier grouped projects (.dsp files) into workspaces (.dsw files). Workspaces have been replaced by solution files (.sln) since Visual Studio.NET (ca. 2001). Incidentally .dsp files were replaced by .vcproj and now .vcxproj files. Your guide may be outdated if it is talking about workspaces.

Related

Visual Studio Express 2013: How to create project with existing C++ source files ?

There has been a lot of discussion about this topic but still no concrete answer about it or atleast I can not find it. I am unable to find the option File->New->Project from existing files
I have already the source files and to avail the advantage of some tools in visual studio express I installed the trial version 2013 and even after playing with it a little bit and looking for it on internet I did not find this option.
Is there any possible way to create project with existing source files like this in 2013 version ?
or should I install some older version ?
Suggestions/comments/solutions .. Please
You could try creating a blank project and then importing the files into it. Not sure if the version you're using is able to do that. Otherwise, create a new project and new source files and copy/paste the code (it's not a great solution).
In Visual Studio Express 2013 I found I was able to export an existing project as a template then build a new project off of that template.
File -> Export Template
then
File -> New Project and the saved Template was available to choose from.
According to http://msdn.microsoft.com/en-us/library/754c3hy7.aspx "This option ( File->New->Project from existing files) is not available in Visual Studio Express editions..." so the short answer would be "no."
#JBentley - the OP asked if he could perform the task "like this", where "this" means "using File->New->Project from existing files".

Visual Studio 2010/2012 Add-in Project Questions

I have already created a simple source code analyses tool for C/C++, but I wanted it to be an extension or tool for Visual Studio 2010 and 2012 editions. It is written completely in C++. For this reason I created it using "Create an Add-in using Visual C++/ATL" option. And then under "Choose Add-in Options", I have some problems. I don't know which one or ones to select. I want it to have a name and icon under Tools section, but on the other hand, my code analyzer can be used from command line too. If someone can advice me which option(s) to select there I would be glad.
My second question is this, when I have opened a source file in Visual Studio, and if I go to Tools -> MyAddin, and press it, I want it to do its job and analyze the code, and show the results in the output section below.
And my last question is that, if I have a C/C++ project with few files let's say, and if I right-click one of the files, I want to see my add-in and be able to execute the add-in from there, not to go always to Tools -> MyAddin. And also the same thing to work if I right-click the project, then it should analyze the all files and show the problems in the output section.
Please note that I have already created the source code analyzer tool in C++, and I have it as a DLL. I can also use it in Linux from terminal, and if I want I can also create a GUI for it, which I plan to do later. But I'm not that much experienced with Visual Studio, especially about add-ins, that's why I need your help. As you can see my first question is a kind of advice, but I think my second and third questions require some source code. I know that it is very hard for you to give me some help without seeing my code, but if you would help me somehow I would be glad.
For Visual Studio 2010 and 2012 you should consider using Extensions, not Add-Ins. It is a new technology introduced in Visual Studio 2010. Extensions come in form of a VSIX packages and are automatically installed in all applicable versions of Visual Studio. If you are not targeting Visual Studio version prior to 2010, I strongly recommend using extensions.
From this point of view, I will not answer any of your technical questions about Add-Ins. Here are a couple of links to start using extensions instead:
Anatomy of a VSIX Package
Building and publishing an extension for Visual Studio 2010
VSX FAQ
Walkthrough: Creating an Options Page
I think you will find valuable information on this topic here: Developing extension packages for Visual Studio 2005/2008/2010/2012 using C# with real-life samples

Sharing a C++ solution between Visual Studio 2010 and 11

Me and my partner are both sharing a c++ solution via subversion.
He is using Visual Studio 11 and I am using Visual Studio 2010.
After the first time he commited and i updated, i get the following error:
Error 31 error MSB8008: Specified platform toolset (v110) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected.
also, in header files i get the following error on #include <stdio.h>:
error: cannot open source file "stdio.h"
I am guessing this is a compatibility issue. How can we resolve this?
In Visual Studio 11 there is a property option that allows you to specify the platform toolset.
Platform Toolset v110 is used by default if you create a new project starting from Visual Studio 11, but if can change it to v100 that is the one used by Visual Studio 2010.
.sln and .vcxproj files saved in Visual Studio 11 are not backward-compatible with VS2010. Even if they were compatible, eventually you'd step across a code which is compilable in VS11 but not in VS10.
The best (and probably the only) way is to agree on using exactly the same development environment.
A bit late in the discussion, but since you're using source control, you can remove the project and solution files from the repository and just share source code. Obviously, if you add new modules and such to a project, you'll have to manually add them in the other solution, but at least you wouldn't have to worry about this incompatibility. If you wanted to get down to it, the application can be built from the command line using just the compiler and linker switches, which tend to be far more compatible between revisions. Finally, you could use another build tool (besides MSBuild), that remains compatible across studio versions.
If you decide to remove the solution and project files, one thing to consider is saving a copy of the original YourApp.sln as YourApp.sln.2010. Then you'll have something to seed future solutions from, but updates to projects and solutions will all need done from VS 2010 and the file then copied to their .2010 version and maintained manually.
If SVN has support for patches, or if you're willing to run quilt externally (or if you switch to mercurial, you can use the MQ extensions), you can create the patch files to convert from 2010 to 2011 and remove the upgrade patche(s) before synch.
Drake's solution didn't work for me as the properties for all projects in the solution were already correctly set to v100. However, the fix that did work was to clean the builds and remove all other files that weren't source files or project files. I think it was probably removing the files projname.vcxproj.user that fixed it, as perhaps the toolchain preference was somehow overriden in the user preferences.

How to downgrade solution from Visual Studio 2010 to Visual Studio 2005?

I have a huge Visual Studio 2010 solution. I work with Visual Studio 2005, so I want to convert the solution to the desired version. Basically, it's a portable C++ code so it should compile on Visual Studio 2005 too. Changing the version in the *.sln file doesn't help because the *.vcxproj format is completely different from the old *.vcproj format.
Recreating the solution by hand is not an option because of its size. Also there may be some non-default compiler flags, dependencies, etc. that I don't know of (and I can't look through ALL this XML junk that I don't understand).
There is already a related question on How Do I Downgrade a C++ Visual Studio 2008 Project to 2005. However, the utility suggested there supports at most Visual Studio 2008.
Any suggestions?
It really totally sucks, that every proprietary IDE today thinks it needs to create its own project file format.
"Dear IDE developers, just use Makefiles and create a nice GUI for it so that also people without Makefile knowledge can use it!" In VS6 it was at least possible to import/export Makefiles, but not today anymore. And it was possible to use nmake for automated builds. No IDE needed to be installed, just the toolchain which could be grabbed by a simple checkout without installation.
I use CMake now. It's free, it's cross-platform, it is well supported in free IDEs like KDevelop, QtCreator, etc. It can generate Makefiles and Visual Studio projects.
So you maintain only one project source, the CMakeLists.txt file and can work with any IDE. No pain with different versions of Visual Studio or with other proprietary project file formats.
This way you can generate or VS projects for developing and you can generate Makefiles for commandline builds using nmake like in the good old days.
BTW, it's much easier to change settings in a CMakeLists.txt than clicking through various GUI dialogs. But this is a matter of personal preferences.
In my work made a utility which utilized the EnvDTE.dll and scanned a vcproj-file and optionally all vcproj-files within a sln-file. It compared all settings with a "template" and would issue a warning or optionally update the setting to correct values. We used this utility so that settings would be verified to be correct and consistent throughout all projects. I haven't updated the utility to 2010 yet due to other priorities.
EnvDTE hasn't changed much from Visual Studio 2008 to Visual Studio 2010. Perhaps it is possible to create a simple utility which opens the vcxproj-file using DTE100 and saves it using DTE90, or earlier.
Easiest way is probably to create a new project in VS 2005, and use the add existing item dialog to add the code to the project. I'd suggest using 'Empty Project' as the project type, so you don't have a lot of rubbish autogenerated for you that you'll just delete anyway.
I haven't tried it, but this looks promising:
http://www.emmet-gray.com/Articles/ProjectConverter.htm
edit: Nope, not promising, sorry :-(

Visual Studio 2008 Express MFC Support

As may be known by many, the Express versions of Visual Studio 2008 don't include support for MFC and a few other packages required to compile a lot of windows programs.
So, here's my problem:
I have the full version of Visual Studio 2005. I've been using this to compile a project that a friend of mine was working on, so that I could test it out for him and continue to track bugs and things. Recently, he upgraded that project to VS 2008, which I don't have. So, I downloaded the express version in the hopes that I could simply compile with that, but no luck, it complains about headers missing left and right.
It seems to me that since I already have the full version of VS 2005, I'm bound to have at least some (perhaps older) version of the files in question that his project needs to compile against.
Is there a way I can convince VS 2008 to also look in 2005's directories for include files and library files to compile against?
Furthermore, is this a bad idea? I would really prefer not to go out and purchase VS 2008 full, as I'll never use it myself. (2005 does the job fine for me at the moment, and I tend to prefer GCC anyway.)
Thanks
You can use the VC++ compiler directly from the command line, or just create a new project w/ the source in Visual Studio 2005. Unless he is using some functionality provided in the new versions of MFC/ATL in 2008/2008sp1, you should be able to compile the project just fine.
See ("Create Project from Existing Source") in Visual Studio 2005. It is unfortunate that they don't include these libraries with the Express Editions.
Use the vcvars*.bat script(s) from Visual Studio 2005. See this blogpost from VC++ Blog to see how. You will use the old compilers, but the build system from Visual Studio 2008.
You can go into Tools>Options>Projects and Solutions>VC++ Directories
and alter the Include, Library, and Source (and Reference maybe?) folders to use VC++ 2005's folders.
I'd guess you just replace $(VCInstallDir) with a hardcoded VS 2005 path. I'd record the original values before doing this.
However, have you just tried using the OLD 2005 sln and vcproj files? Keep using 2005 on your end and 2008 on his. Keep two sets of these files for each IDE. Any issues are going to be with the library mismatch - which you're not avoiding by using 2008's tools with 2005's libraries.
The simple way to deal with this would be to revert the solution and project files back to their visual studio 2005 state from source control(you are using source control right?). At this point you can compile the project as long as your friend does not use any of the mfc 9 only functions.
The first thing I would try is loading this up in VS 2005 by just modifying the version of the .sln and the .vcproj files. In the .vcproj change the version from 9.00 to 8.00 and in the .sln change the format version from 10.00 to 9.00.
If you don't have fancy stuff in the project you have a high chance of just being able to use it like this. Also this would avoid having to update 2 project and solution files.
On this website it is shown how MFC code can be compiled with the Visual Studio Express versions:
link
Just for the record, I've done that(by modifying the include directories and library directories from inside the IDE) and it's working pretty well, I have MFC, ATL, everything.
I've found this explanation. http://www.codeproject.com/Articles/30439/How-to-compile-MFC-code-in-Visual-C-Express