在 Visual Studio 2017 中添加 ATL 简单对象
我正在 Visual Studio 2017 中使用旧的 ATL/COM 项目.
I am working with an old ATL/COM project in Visual Studio 2017.
在以前版本的 Visual Studio 中,您可以选择添加类",然后选择添加简单 ATL 对象"选项以将 COM 类添加到项目中.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.
选项被移动了吗?
我是否错过了安装选项?
Have I missed an installation option?
Visual Studio 是否无法将我的项目识别为 ATL 项目?(它是用一个更旧的版本创建的.)
Does Visual Studio fail to recognize my project as an ATL project? (It was created with a much older version.)
或者这是 ATL 之路的尽头?
Or is this the end of the road for ATL?
我不确定这是否是一个答案,但对于评论来说太多了,而不仅仅是对问题的编辑.
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 社区 2017,版本 15.1
- Visual Studio Professional 2017,版本 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.
在这两种情况下,我都创建了一个新的 ATL 项目并尝试了三种添加类的方法:
In both cases I created a new ATL project and tried three ways to add a class:
- 从类视图 的上下文菜单中添加类...
- 从解决方案资源管理器 的上下文菜单中添加类...
- 从解决方案资源管理器 的上下文菜单中添加新项目...
在 15.1 版中,添加类会打开以下对话框,我可以从中添加 ATL 简单对象.
With version 15.1, Add Class opens the following dialog, from which I can add an ATL Simple Object.
在 15.3.2 版中,添加类会打开以下对话框,但没有任何 ATL 简单对象选项.
With version 15.3.2, Add Class opens the following dialog, without any option for an ATL Simple Object.
但是,在 15.3.2 版本中,添加新项会打开以下对话框,其中包含一个用于创建 ATL 简单对象的新选项,该选项以前在此对话框中不可用.
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.
因此,功能似乎已被移动.奇怪的是,它在类视图中不再可用(我认为这是一个错误).
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).