How to create custom plugin like references in visual studio? - visual-studio-2017

If you have used visual studio then you are aware that it will display no references particular method has and even display same for class and fields. I want to create such plugin or extends the same plugin so additional information can be available with those information.

Related

How to add .ui file in Visual Studio (2010) project and compile it

I'm new in using Qt and I have a problem. I have created a simple window (.ui File) with Qt Designer and saved it.
Now I want compile it with Visual Studio 2010 . How can I add an external .ui file into my Visual Studio Project and compile it?
Should I create a new class in the project? If yes, how?
The best option (and probably the only one unless you are using CMake or similar) is to use the official Visual Studio Qt add-in (download from here): it will handle all the pre-processing steps required by some of Qt functionalities (C++ classes moc'ing, UI compilation...). It will also associate Qt files (.ui, .qrc, .ts) to respective editors.
Basically, you create a new Qt project, then create the .ui (you can use the one that comes with the template), create a class that inherits from the respective widget (QWidget, QDialog, QMainWindow) (again, there is one with the default project). From that class you setup the UI (you link the .ui and the C++ class, let's say), create slots and connect them with the UI elements, etc.
For a step-by-step tutorial please take a look at the official manual, specially the getting started section.

How to: Create Item Templates in Visual Studio 2017

How to: Create Item Templates in Visual Studio 2017. In VS 2015 from the File menu there was an Export Templates item from which projects or item could be created. Is this feature still available or just moved? thx
As stated by Guru Stron above, the template will be exported to the "C:\Users\[UserName]\Documents\Visual Studio 2017\My Exported Templates" folder as a zip file. In order to use this template, you will have to move or copy it to the following folder... C:\Users\[UserName]\Documents\Visual Studio 2017\Templates\ProjectTemplates. Additionally, if you want to further define where in the New Projects dialog box your template will appear, you will need to dig deeper in the path.
For example, if you have a .NET core template written in C#, you will want to place your template in this path... C:\Users\[UserName]\Documents\Visual Studio 2017\Templates\ProjectTemplates\Visual C#\.NET Core. Of course, you may need to add the last folder (.NET Core).
The coolest thing about this is that you can create a collection of templates for your own organization, you could place the templates in a path such as... C:\Users\[UserName]\Documents\Visual Studio 2017\Templates\ProjectTemplates\Visual C#\Daffitt Technologies\.NET Core. This will look something like this:
One thing to note, is that there may be other tweaks you’ll have to do to the files contained in the zip file – particularly the MyTemplate.vstemplate file. I noticed that the created project templates don’t always create the results I expected.
I did find Create Item Templates in Visual Studio 2017 under the Projects menu. And I am able to export items and import them in to other projects.
it moved to project menu however I have exported several things and none of them show up haven't figured out how to make it work
As stated in other answers, the option is in the Project menu. The documentation for this is now at https://learn.microsoft.com/en-gb/visualstudio/ide/how-to-create-item-templates

dynamically creating GUI in QT without using forms in visual Studio

I have installed QT5 in visual studio.
I want to create my GUI dynamically at run-time. Hence I cannot use any designers or forms. How do I do that? Which template should I create in visual Studio? Also which QT libraries do I have to include to achieve the same?
Designers and forms are only helpers that end up with generating C++ code that you want to write yourself. So you can create a form (in designer), build your project and see generated code, from which you can learn how to create and setup UI objects. You can then leave those forms aside and write your code using generated one as code snippets.
Anyway, the short answer to you question "how to create my GUI dynamically at run-time" is: create objects of UI classes (such as QMainWindow) and manipulate then using Qt API
Which template should I create in visual Studio? - C++, Win32 Project
which QT libraries do I have to include? - Again, use Qt Creator as a "teacher". Once you have a project built in Qt Ctreator, look at its "Compile output" window. From there you will learn what compiler and linker settings are needed
Practice building the forms in Qt Designer. Then go to Form -> View Code and look at the layout code. This is an example of the C++ code that you can use yourself to build widgets at run time.
When you write your own widget without designer, you can simply subclass QWidget and add buttons, dropdowns, etc. Or you can try overriding paint events to do custom painting.

How to get ATL support into an existing Windows application

I'm building an application using Qt 5.3.1 in Visual Studio 2012. I also want to use a hardware library which requires me to add a simple ATL object to the project. This can be done by using a Visual Studio wizard. The wizard complains that my project is neither an MFC executable nor an MFC DLL with full ATL support.
My question is: How can I add this support to my application? In the project properties I configured the project to link to the ATL and use the MFC. It did not work. Both statically and dynamically.
If there's another solution in order to add a simple ATL object to the project, please let me know.
The wizard which adds ATL support works on source code of the C++ project, including both checking if the current code is already ATL project, whether the project is okay for adding ATL support to, and code modification per se.
If the wizard "does not like" something in your project it displays an error which basically means that the wizard does know how to safely modify your source code. It does not however mean that adding ATL support is impossible. And enabling an option in project settings is insufficient since source code needs some explicit initialization stuff.
The best you can do to add ATL support without thinking too much about it, is to create a new empty project that matches the project type you currently have, e.g. MFC application. Then take a snapshot of source code, then add ATL support using the wizard. Then compare changes and duplicate them on your real project. The same applies to next step of adding ATL Simple Object using Visual Studio wizard.
Some relevant links (even though the method above looks the easiest to me):
How To Add ATL Support to an MFC EXE
Adding ATL support to existing mfc application
Add automation support to MFC DLL

How to create ActiveX DLL in Visual C++

Is there a tutorial/reference for creating an ActiveX DLL in Visual Studio 2008 C++ ?
I've got a DLL built with the DLLRegisterServer/UnregisterServer, and it's registered, but I'm having a little trouble figuring out what name to use to reference it (from a vbscript) and how to make sure my functions are exported correctly. Do I have to put my functions in a special class?
Thanks!
There are a lot of details to get right. Best thing to do is to use ATL and the built-in ATL object wizard. It auto-generates a bunch of files so that the IDL, type library, registration script, class wrapper and event proxies are all done correctly.
The component's ProgID is normally defined in the project's .rgs file.
+1 to nobugz
how to make sure my functions are exported correctly
Visual Studio contains OleView.exe. You can open your dll from it and see the list of props and methods.
As for tutorial, check here: ATL Concepts