P
piyush
I am facing a problem accessing Outlook AdvancedSearch function. The
scenario is this :
A windows messages (WM_COPYDATA etc) based application uses custom
messages to recieve the phone number of an incoming call from a low
level application. This then (as part of the windows message handler)
on a specific message, invokes the Outlook functionality coded up in a
separate DLL, passing the phone number received.
The oultook functions would use the number to look up the contacts,
inbox and other MAPI folders. The problem is in this case, at the
point when I call the AdvancedSearch function, an exception is thrown.
System.Runtime.InteropServices.COMException (ox8001010D) : An
outgoing call cannot be made since the application is dispatching an
input-synchronous call.
The same problem occured when I had the statements like
Outlook.Items contactItems = contactsFolder.Items
as part of the function that is called externally.
The workaround for the second problem was to move out these statements
from the function body to the constructor body of the DLL.However, I
cannot move the AdvancedSearch function to the constructor !
The surprising part is that the same error does not occur when I try
to access the outlook function using a different standalone "console"
baed application. However, I had to remove statements like
Outlook.Items contactItems = contactsFolder.Items
out into constructor body.
Therefore, apparently I cannot access the AdvnacedSearch function in a
function body that gets called by an external "windows messages based
application" ?!!
The windows message based application that I use hangs and only upon
my fidgeting the taskbar with a right click, does the exception gets
thrown.
Any workarounds greatly appreciated. I need help please !
Thanks !
Piyush
scenario is this :
A windows messages (WM_COPYDATA etc) based application uses custom
messages to recieve the phone number of an incoming call from a low
level application. This then (as part of the windows message handler)
on a specific message, invokes the Outlook functionality coded up in a
separate DLL, passing the phone number received.
The oultook functions would use the number to look up the contacts,
inbox and other MAPI folders. The problem is in this case, at the
point when I call the AdvancedSearch function, an exception is thrown.
System.Runtime.InteropServices.COMException (ox8001010D) : An
outgoing call cannot be made since the application is dispatching an
input-synchronous call.
The same problem occured when I had the statements like
Outlook.Items contactItems = contactsFolder.Items
as part of the function that is called externally.
The workaround for the second problem was to move out these statements
from the function body to the constructor body of the DLL.However, I
cannot move the AdvancedSearch function to the constructor !
The surprising part is that the same error does not occur when I try
to access the outlook function using a different standalone "console"
baed application. However, I had to remove statements like
Outlook.Items contactItems = contactsFolder.Items
out into constructor body.
Therefore, apparently I cannot access the AdvnacedSearch function in a
function body that gets called by an external "windows messages based
application" ?!!
The windows message based application that I use hangs and only upon
my fidgeting the taskbar with a right click, does the exception gets
thrown.
Any workarounds greatly appreciated. I need help please !
Thanks !
Piyush