Add ATL Simple Object in Visual Studio 2017
Asked Answered
F

3

6

I am working with an old ATL/COM project in Visual Studio 2017.

In previous versions of Visual Studio you could select "Add Class" and then select the option "Add simple ATL object" to add a COM class to the project. This option appears to be completely missing in Visual Studio 2017.

Has the option been moved?

Have I missed an installation option?

Does Visual Studio fail to recognize my project as an ATL project? (It was created with a much older version.)

Or is this the end of the road for ATL?

Farrel answered 2/10, 2017 at 8:45 Comment(2)
It is still available in my version of VS2017.Fairground
Did you add the ATL support first to your project?Depot
F
9

I'm not sure whether this an answer, but it is too much for a comment and more than just an edit to the question.

I have tested on two systems, with

  • Visual Studio Community 2017, Version 15.1
  • Visual Studio Professional 2017, Version 15.3.2

and I believe that the functionality has changed between these two versions. I think it is unlikely to be a difference between the Community and Professional versions.

In both cases I created a new ATL project and tried three ways to add a class:

  1. Add class... from the context menu in the Class View
  2. Add class... from the context menu in the Solution Explorer
  3. Add New Item... from the context menu in the Solution Explorer

With version 15.1, Add Class opens the following dialog, from which I can add an ATL Simple Object.

enter image description here

With version 15.3.2, Add Class opens the following dialog, without any option for an ATL Simple Object.

enter image description here

However, with version 15.3.2, Add New Item opens the following dialog, with a new option to create an ATL Simple Object, which was previously not available in this dialog.

enter image description here

So, it seems that the functionality has been moved. Curiously, it is no longer available in the Class View (which in my opinion is a mistake).

Farrel answered 3/10, 2017 at 6:50 Comment(0)
A
3

This problem is caused by changes in the project template and code wizard in version 15.3 of Visual Studio 2017.
The operation procedure has changed between version 15.2 or earlier and version 15.3 or later.
The blog article that explained this change is as follows.
Changes to Project Templates and Code Wizards in 15.3

Although it is described as an item in the release notes, there are few people who are watching, and details on how the actual is going on is unknown.
Visual Studio 2017 version 15.3 Release Notes
C++ Language Services
Project and Code Wizard
•We have rewritten several project and code wizards in the signature dialogue style.
•Add Class launches the Add Class wizard directly. All of the other items that were previously here are available under "Add > New Item".
•Win32 projects are under the Windows Desktop category in the New Project dialog.
•The Windows Console and Desktop Application templates now create the projects without displaying a wizard. There's a new Windows Desktop Wizard under the same category that displays the same options as before.

Arezzini answered 22/12, 2017 at 4:20 Comment(1)
Thanks for the explanationFarrel
W
0

My experience with Visual Studio 2015 version 15.9.2 is that I had to uncheck Security Development Lifecycle (SDL) checks when I added an ATL Project, otherwise when I add the Simple ATL Object I get a messagebox with the error "did not find a .idl file in project name of my project". enter image description here

Westnorthwest answered 11/12, 2018 at 7:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.