Addin conflicts with other integration

  • Thread starter Thread starter Mark Smith
  • Start date Start date
M

Mark Smith

My addin creates a toolbar button that allows me to send the contents of an
e-mail to another program. The addin packages up the e-mail and then sends
it to the other program using a WM_COPYDATA message. After the SendMessage
call returns, control is returned immediately to Outlook's main thread.

The other program accepts the data from the WM_COPYDATA message and then
calls ReplyMessage so Outlook stops waiting. The program then displays a
modal dialog showing the e-mail which allows the user to save the e-mail in
that program.

In a separate integration with Outlook, we call CLSIDFromProgID() and
GetActiveObject() to hook up to the currently running session of Outlook.
If this other integration is initiated while the e-mail dialog is still
showing, the GetActiveObject call returns the following error: "An outgoing
call cannot be made since the application is dispatching an
input-synchronous call".

I understand what the error message is saying, but it doesn't make sense in
this case, because the addin button handler has already returned execution
control to Outlook's main thread at this point.

Does anybody have any ideas why this may be happening? Or know of a better
place to post this question?

Thanks,
Mark
 
Ah, I figured it out. I was looking at it from the wrong perspective. The
problem was not with Outlook, but with my program. It was happening because
I was still inside the WM_COPYDATA handler (which necessarily has to be a
SendMessage) when displaying the modal dialog. Once I did all I could in
the WM_COPYDATA handler and then displayed the modal dialog within a
different posted message handler, my problem went away. So it had nothing
to do with the addin at all...

Mark
 
Back
Top