VS Extension which declares a new project template and locate the generated project in a specific location of an imported tree - templates

I would like to create a Visual Studio extension.
I installed Visual Studio 2012 and Visual Studio SDK 2012.
Now, I want my extension to create a new project template, and then to enable the user to create a new project of the new generated type. i.e: I would like that once the user will open VS and will click on "add new project", he will have a new project type in the list of the regular templates. The template will be a standard C project, with some additinal dependencies, some changes in the.vcxproj file, in the compiling configurations and more.
In additinal, I want that on the project creation, my extension will import an existiong solution from my computer to be the current VS solution, and that the new project will be added to a specific folder in that solution.
Is there any way to write code which is doing the described above, on the creation of a new project of the new template? Do I have any event/other handler on the template code, or in the package code, which I can use?
I googled tons, but I really don't know what is the best way I can do it...
Thanks a lot!

Related

How to create "Multi Project Template With Custom Wizard" in Visual Studio 2017

I'm looking for help on making a multi project template (i.e. a deploy-able solution that contains multiple projects) with a custom wizard (to enable custom parameters to be entered).
I've followed "How to: Create Multi-Project Templates" to make the multi project template. This is working.
I've followed "How to: Use Wizards with Project Templates" to make my wizard in my VSIX files. This is working.
However, I can't get them to work together. I can either deploy my multi project template without a wizard OR I can get all of my individual project templates to show in the project gallery, via my VSIX file, with a working custom wizard.
Any ideas on how to combine the two methods?
I was able to adopt an answer from this blog.
The key is to package all of your exported projects (which come in ZIP which you have to extract) and your root .vstemplate file into a ZIP. This ZIP then needs to be an imported project template in your VSIX project.
Lastly, your wizard needs to be its own separate project you can reference in any of your individual project templates or in your VSIX. I had my wizard being created in my VSIX which just didn't seem to work.
As stated by Dan, you need to have your multi-project templates in a zip file.
However, you do not need to have the wizard code in a separate project, you can have it all in your VSIX project.
I your VSIX project, to add a reference to your .zip file, open your source.extension.vsixmanifest designer -> Assets -> New -> Select type Project Template and Source 'File on filesystem' and select your zip file.
Make sure to also add your VSIX project as Assembly if you haven't already: New -> Select type Assembly and Source 'a project in current solution' and select your VSIX project. (This is probably why it didn't work for Dan)
In your multi-template.vstemplate file you need to add a reference to the VSIX dll as described in "How to: Use Wizards with Project Templates" using <WizardExtension>
In addition you can also add a <CustomParameters> section inside <TemplateContent> if you want to set up default custom parameter values. See here for more info: "The registration elements for customizing the template wizard"
Example:
<CustomParameters>
<CustomParameter Name="$mycustomparameter1$" Value="value1"/>
<CustomParameter Name="$mycustomparameter2$" Value="value2"/>
</CustomParameters>

Create a DLL from a CPP file called by ctypes

I have some functions defined in a cpp file, that is used in a game made in Python using ctypes.
I wanted to create a DLL with this cpp file, so that I could call it later in Python in Windows. For that I have been trying to use Visual Studio 2015, but I have not been able to do it.
Could you help me create the DLL?
In visual studio, access your project properties by right-clicking your project and selecting Properties. From there go to Configuration Properties->General check for the field Configuration Type and set it to Dynamic Library (.dll). That's it!
Is that what you wanted to know?

Multiple file compilation in visual C++ 2010

I have a very specific question in regards to visual C++ 2010 express. I have looked everywhere but can't find instructions on how to compile several source files. I have programmed on Unix at the command line and am trying to learn visual C++ 2010. I am using a header file that contains the function declarations and global variables. I don't know if this is the correct venue to ask this question but if anyone knows of some place where I can get the answer I would be grateful
Thanks,
Ral
If you have a project that you build from the command line with a makefile, then the Visual Studio development environment will not recognize your project. To open and build your project using Visual Studio, first create an empty project containing the appropriate build settings using the Makefile Project Wizard. You can then use this project to build your project from the Visual Studio development environment.
The project displays no files in Solution Explorer. The project specifies the build settings, which are reflected in the project's property page.
The output file that you specify in the project has no effect on the name that the build script generates; it declares only an intention.
Source: Creating a Makefile Project (VS2013)
On the menu: File->New->Project
On the dialog:
select Win32 Console Application,
enter Name ( like you did in the -o in unix) in the bottom,
and press OK
On the next dialog: Press next.
On the next dialog:
unmark Precompiled headers
mark Empty project
press Finish
Now find the Solution Explorer tree. You have Solution name and a project with the same name in it.
Right click on the project (not solution)
choose Add->Existing Item
and select your files, (you can copy them to the opened folder and then choose them)
press Add
Now you can try to compile.

How to compile a cpp to a dll in visual studio 2010 express

I have a cpp which depends on couple of headers in the same folder. I need to compile this cpp to a dll. How do I do it in visual studio 2010 expresS?
I found few articles on web for visual studio 2008 but I could not use it in 2010. Any pointers would be highly appreciated. Btw, I am a java programmer. CPP is all new to me, I am compiling some one else's cpp to dll.
Thanks,
Abi
Right-click on your project in the Solution Explorer, and select Properties.... Under Configuration Properties -> General there's an option called Configuration Type. If you change it to Dynamic Library (.dll), your project will generate a DLL when it is built.
As a start point, you can use "Create New Project from Existing Code" as described here - specify that you want a DLL project when prompted.
Once you have a project in place that encapsulates your CPP code file, you can find other info on specific project settings in MSDN, or post new questions as you need to.

How to add an existing VC6 project in to a workspace from add-in or VBS macro

I want to add an existing VC6 project in to a workspace from add-in or VBS macro.
There is no function to insert an existing project in Developer Studio's Application object.
So I tried to add a new project (with the same name of existing project) using Application's AddProject method and then overwrite the project file created with my existing project file. But it did not work.
Is there any other way to achive this. Please help.