IOleCommandTarget

Hi, I am writing an ATL Object that needs to implement IOleCommandTarget?  What exactly is involved here?  I'm pretty new to this ATL stuff.  How do I do this?
LVL 1
perrizoAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Tommy HuiConnect With a Mentor EngineerCommented:
If your object needs to support IOleCommandTarget, simply

1. Derive your object from IOleCommandTarget.
2. Provide implementations for the methods on IOleCommandTarget (Exec and QueryStatus)
3. Modify the COM_MAP section to include

   COM_INTERFACE_ENTRY(IOleCommandTarget)

That's all you will need to do.
0
 
perrizoAuthor Commented:
Thanks, Thui.  That was rather painless.  I do have another question but, instead of posting another I thought I would just give it a shot here and increase the points.  I've added a menu item to the tools menu as well as the toolbar button I mentioned before.  Now after the first time the button is pressed or the menu item chosen the toolbar button greys out but the menu item is still available.  Choosing the menu item works every time but, I can only press the toolbar button once before it becomes inactive?  Any ideas why?
0
All Courses

From novice to tech pro — start learning today.