Search code examples
visual-c++comstatic-methodsatldllexport

How to add a static method into ATL object?


I am trying to write a simple COM/ATL DLL following the link http://www.codeproject.com/Articles/505791/Writing-Simple-COM-ATL-DLL-for-VS, but it does not mention how to add a static method to ATL object.

Can I add a static method to ATL object?

Thanks and best regards!


Solution

  • When you use the class wizard on ATL classes you get only the option to add methods to the COM interface. You have to modify the class manually when you want to add something that is not in the COM interface.

    So you have just to add the static method with the text editor in the header file and of course you have to add the implementation in the .cpp file.