Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I have an ATL COM project which I want to port to 64 bit.

After changing the platform to x64 and starting the build I get among other errors the following

ATL::CComContainedObject<contained>: C2259 Cannot instantiate abstract class in atlcom.h

I also get this error

C2338 CAtlDllModuleT<T> must be used with either _WINDLL or _USRDLL in atlbase.h

It compiles fine on 32bit. Does anyone have an idea of how to solve this? I have found this similar question and answer, but I can't understand how to apply it in my case.

https://social.msdn.microsoft.com/Forums/vstudio/en-US/d6144eaa-fa37-4133-87a0-75a06633209b/compiling-64bit-results-in-a-2259-cannot-instantiate-abstract-class?forum=vclanguage

I have posted a similar broader question earlier:

ATL COM 32-bit dll to 64-bit non-COM dll

ATL is compatible with 64-bit, but it does not mean you can take any existing (old?) project and hope it will build Win64 w/o a problem. The initial error is very generic, it just mean there's a problem between definition and implementation (it can be many things like argument size, attributes, pointers, etc..). You probably have more information in the detailed output on the class/method, etc. It's difficult to help w/o more details. Another solution is start a new project with the new VS 2017 templates, and add your files one by one (more work but you'll know what your doing) Simon Mourier Oct 9, 2018 at 8:36 @SimonMourier Thank you for your comment. It seems as I did a very newbie mistake. I didn't take time to copy the settings from the 32bit profile to the 64bit. A lot of important parameters were not set right. After updating the 64bit profile it builds without problem. Now remains to test if the 64-bit dll works as intended. Johan Ahlqvist Oct 9, 2018 at 9:01

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .