Visual C ++: Implementing the ATL Interface

I think this is a real dumb question, but I could not find the answer. I am trying to implement a COM interface using ATL. According to this , I have to use the Interface Wizard . My question is how to find the desired interface in this wizard. Should I iterate over all libraries? Described somewhere in the interface documentation ( IOleCommandTarget )

+4
source share
1 answer

To implement the necessary interface:

  • inherits your class from it
  • add it to the interface card
  • implement your methods

For instance:

class CFoo : // regular COM object base class, esp. those generated by ATL Simple Object Class Wizard public IOleCommandTarget { BEGIN_COM_MAP(CFoo) // ... COM_INTERFACE_ENTRY(IOleCommandTarget) END_COM_MAP() // ... public: // IOleCommandTarget STDMETHOD(Exec)(...) // IOleCommandTarget methods go here { // ... } }; 
+5
source

All Articles