EventHandling?

R

Ram

Hi,
i am using outlook2000 and VC++6.0
i have written a COM-Addin. In this addin i have added two
buttons to the outlook explorer.
I have written event handling by using sinking . Here i have used
"IDispsimpleEventImpl" interface.

i have done successfully.

But i want to add CommandBarButtons and menu button to Inspector window
also.
For this reason we have handled "InspectorEvents"

The addition of all Buttons and DispAdvise have written in Invoke method to
add buttons Inspector Windows
But no Buttons are added.

Inspite of that i am facing another problem, that is , when i click button
which is on Explore window this invoke method is calling ,so event handling
is failed.

Please suggest me how can resolve this solution.
How can add buttons to Inspector Windows
 
M

Melbin

How can add buttons to Inspector Windows?

You try to handle the Outlook::InspectorsEvents NewInspector event and then
get the CComQIPtr<_Inspector> spInspector(pdispInspector);
CComPtr<_CommandBars> pCmdBars;
hr = spInspector->get_CommandBars(&pCmdBars); and thus add the buttons
and menu.
Melbin
 
R

Ram

hi,
Thanks for your response.

i have handled Outlook::InspectorsEvents new inspector event. for this i
have written onInspectorwindow method.
in this method i have written the code for adding the button to inspector
window. But when i try run, it gives errors.

Suggest me how can i resolve this

--
Regards,

RamakoteswaraRao Koti
Software Engineer,
Nannacomputers Pvt Ltd
 
R

Ram

Hi,

Thanks very much i have resovle the problem
here is the solution

we have to handle InspectorEvents and we have to write new method,
which will be called when inspector window is called.
in that method we have to pass

void __stdcall CAddin::OnNewInspector(CComQIPtr<Outlook::_Inspector>
inspector)



like this. creation and adding the button are normal,like how we create for
explore window.

thanks all for your help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top