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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tommy HuiEngineerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.