I am writing a tool which inspects my source tree looking for .vcproj and .csproj projects (VS2005). I want it to know if each project is an application, DLL or static lib project.
For C#, I think this question has an answer ( How do you tell the Visual Studio project type from an existing Visual Studio project ) but I can't find an obvious parallel in C++ projects. I prefer something I can use as a simple search term in the text if possible.
If you are working in Visual Studio, you can quickly check the project format using one of the following methods: Right-click the project in Solution Explorer and select Edit myprojectname. csproj. This option is only available starting in Visual Studio 2017 for projects that use the SDK-style attribute.
Right Click on Project of a solution. Open Properties -> Application Tab. On the right you can see 'Output Type' which defines your project type of an existing solution.
All you need to do in order to use such library (either in .exe or . dll ) is to include proper headers and link them - with Visual Studio it's pretty easy. First of all, you need to know 1) where your static libraries are placed and 2) their exact names. Go to project properties and then General .
You'll need to parse the "ConfigurationType" attribute in the .vcproj file. An attribute of the <VisualStudioProject><Configurations><Configuration>
element. It is "2" for a DLL project, "4" for a static library project. Beware that different configurations can have different values for this attribute, albeit that this will be very unusual.
You in general reverse-engineer these things by making a copy of the .vcproj file, make a change in the Project + Property pages, use File + SaveAll and then compare the two .vcproj files to see what changed.
Do watch out a bit for putting a lot of effort into such an old version of Visual Studio. Eight years is a very long time in software engineering, especially so after the C++11 standard was released. The C++ project file format dramatically changed at VS2010, now a .vcxproj file that joined the rest of the languages in VS by supporting builds through MSBuild. You are bound to have to redo all this when you upgrade your VS version some day. Better do that now since it sure won't be any easier doing it later when you came to depend on your tool.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With