如何获得ATL支持到现有的Windows应用程序 [英] How to get ATL support into an existing Windows application

查看:367
本文介绍了如何获得ATL支持到现有的Windows应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 2012中使用Qt 5.3.1构建一个应用程序。我还想使用一个硬件库,它要求我添加一个简单的ATL对象到项目。这可以通过使用Visual Studio向导来完成。该向导抱怨我的项目既不是MFC可执行文件也不是完全ATL支持的MFC DLL。

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.

我的问题是:如何将此支持添加到我的应用程序中?在项目属性中,我将项目配置为链接到ATL并使用MFC。它不起作用。静态和动态。

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.

如果有另一个解决方案为了添加一个简单的ATL对象到项目,请让我知道。

If there's another solution in order to add a simple ATL object to the project, please let me know.

推荐答案

添加ATL支持的向导适用于C ++项目的源代码,包括检查当前代码是否已经ATL项目,该项目是否可以添加ATL支持和代码修改本身。

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.

如果向导在项目中不喜欢某些内容,它会显示一个错误,这意味着向导知道如何安全地修改源代码。然而,这并不意味着添加ATL支持是不可能的。并且在项目设置中启用一个选项是不够的,因为源代码需要一些明确的初始化东西。

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.

你可以做最好的添加ATL支持而不想太多,以创建与您当前拥有的项目类型匹配的新空项目,例如MFC应用程序。然后拍摄源代码的快照,然后使用向导添加ATL支持。然后比较更改并在真实项目上复制它们。这同样适用于使用Visual Studio向导添加ATL简单对象的下一步。

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

这篇关于如何获得ATL支持到现有的Windows应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆