简体   繁体   English

我可以将MFC支持添加到现有的ATL COM项目中吗

[英]Can I add MFC support to an Existing ATL COM project

I have created a Shell Extension using ATL COM Object . 我已经使用ATL COM对象创建了一个Shell扩展。 But during creation I haven't added MFC support. 但是在创建过程中,我没有添加MFC支持。 Can I change the setting now to add MFC support 我现在可以更改设置以添加MFC支持吗

Yes, but I believe that doing this won't auto-add all the required headers and #defines - of course, you could try this first, and check to be sure. 是的,但是我相信这样做不会自动添加所有必需的标头和#defines-当然,您可以先尝试此操作,然后检查一下是否确定。

If that does not work, you could use 'File->New->Project from Existing Code' to create a new project in your solution that uses both MFC and ATL, using the code in your original project. 如果这不起作用,则可以使用“原始文件”->“新建”->“现有代码中的项目”,使用原始项目中的代码在使用MFC和ATL的解决方案中创建一个新项目。 You would have to include any custom settings from your current ATL-only version, but if you let a new precompiled header be created in the new project, it should have all the MFC and ATL bits you need turned on and included. 您将必须包括当前仅ATL的版本中的所有自定义设置,但是如果您允许在新项目中创建新的预编译标头,则它应该已打开并包含了所有需要的MFC和ATL位。

Yes, there is a knowledge base article that says how to do this. 是的,有一篇知识库文章介绍了如何执行此操作。 In short, you basically have to add certain #include s and create an application object, along with some plumbing. 简而言之,您基本上必须添加某些#include并创建一个应用程序对象以及一些管道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM