Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Tue, 29 Jul 2008 14:38:59 -0500,    group: microsoft.public.platformsdk.mapi        back       


MAPI_E_CALL_FAILED ?   
Recently, I noticed that the message store OpenEntry code fails with 
MAPI_E_CALL_FAILED  when opening mails on a certain exchange 2003 server. 
This does not happen on other exchange servers for which the same code is 
running.

ULONG uObjType = 0;
LPMESSAGE pMessage = NULL;

hr = pMsgStore->OpenEntry(entryId->cb, (LPENTRYID)entryId->lpb, NULL, 
MAPI_BEST_ACCESS, &uObjType, (LPUNKNOWN FAR *)&pMessage);
if (FAILED(hr))
{
//log error
}

What causes a MAPI_E_CALL_FAILED for IMessageStore::OpenEntry

thanks
date: Tue, 29 Jul 2008 14:38:59 -0500   author:   Scott McFadden

Re: MAPI_E_CALL_FAILED ?   
Open it through the folder interface!! If you try to open the message 
through the store interface, the store provider is not always able to 
locate the message!

Just imagine how much work the store provider has do if you call 
OpenEntry without specifying the type or interface, it has search each 
and every item that exist in the store, be it folder, message, or other 
special things.

Scott McFadden wrote:
> Recently, I noticed that the message store OpenEntry code fails with 
> MAPI_E_CALL_FAILED  when opening mails on a certain exchange 2003 server. 
> This does not happen on other exchange servers for which the same code is 
> running.
>
> ULONG uObjType = 0;
> LPMESSAGE pMessage = NULL;
>
> hr = pMsgStore->OpenEntry(entryId->cb, (LPENTRYID)entryId->lpb, NULL, 
> MAPI_BEST_ACCESS, &uObjType, (LPUNKNOWN FAR *)&pMessage);
> if (FAILED(hr))
> {
> //log error
> }
>
> What causes a MAPI_E_CALL_FAILED for IMessageStore::OpenEntry
>
> thanks
>
>
>
>   

-- 
Regards,
Ashutosh Bhawasinka
email: discussion@ashutosh.in
MCSA - Messaging,
MCTS - .Net Windows Apps
date: Wed, 30 Jul 2008 02:09:19 +0530   author:   Ashutosh am

Re: MAPI_E_CALL_FAILED ?   
I did notice that it magically happens after 250 emails have been processed. 
I am dilgent to release the IMessage so not sure what the resource leak is.

However, I will try to use the folder interface instead of the message 
store.

thanks



"Ashutosh" <smbs-msdn@nospam.nospam> wrote in message 
news:OvGawsb8IHA.1200@TK2MSFTNGP04.phx.gbl...
> Open it through the folder interface!! If you try to open the message 
> through the store interface, the store provider is not always able to 
> locate the message!
>
> Just imagine how much work the store provider has do if you call OpenEntry 
> without specifying the type or interface, it has search each and every 
> item that exist in the store, be it folder, message, or other special 
> things.
>
> Scott McFadden wrote:
>> Recently, I noticed that the message store OpenEntry code fails with 
>> MAPI_E_CALL_FAILED  when opening mails on a certain exchange 2003 server. 
>> This does not happen on other exchange servers for which the same code is 
>> running.
>>
>> ULONG uObjType = 0;
>> LPMESSAGE pMessage = NULL;
>>
>> hr = pMsgStore->OpenEntry(entryId->cb, (LPENTRYID)entryId->lpb, NULL, 
>> MAPI_BEST_ACCESS, &uObjType, (LPUNKNOWN FAR *)&pMessage);
>> if (FAILED(hr))
>> {
>> //log error
>> }
>>
>> What causes a MAPI_E_CALL_FAILED for IMessageStore::OpenEntry
>>
>> thanks
>>
>>
>>
>>
>
> -- 
> Regards,
> Ashutosh Bhawasinka
> email: discussion@ashutosh.in
> MCSA - Messaging,
> MCTS - .Net Windows Apps
date: Tue, 29 Jul 2008 16:47:28 -0500   author:   Scott McFadden

Re: MAPI_E_CALL_FAILED ?   
Ok, per Ashutosh's advice changed to opening the IMessage using the folder 
interface instead of the message store interface.    Similar problem,  after 
250 emails opened, subsequent OpenEntry attempts fail.   I make sure to 
release the IMessage on each iteration.   Appears to be some kind of 
resource leak.  Not sure what though.


"Ashutosh" <smbs-msdn@nospam.nospam> wrote in message 
news:OvGawsb8IHA.1200@TK2MSFTNGP04.phx.gbl...
> Open it through the folder interface!! If you try to open the message 
> through the store interface, the store provider is not always able to 
> locate the message!
>
> Just imagine how much work the store provider has do if you call OpenEntry 
> without specifying the type or interface, it has search each and every 
> item that exist in the store, be it folder, message, or other special 
> things.
>
> Scott McFadden wrote:
>> Recently, I noticed that the message store OpenEntry code fails with 
>> MAPI_E_CALL_FAILED  when opening mails on a certain exchange 2003 server. 
>> This does not happen on other exchange servers for which the same code is 
>> running.
>>
>> ULONG uObjType = 0;
>> LPMESSAGE pMessage = NULL;
>>
>> hr = pMsgStore->OpenEntry(entryId->cb, (LPENTRYID)entryId->lpb, NULL, 
>> MAPI_BEST_ACCESS, &uObjType, (LPUNKNOWN FAR *)&pMessage);
>> if (FAILED(hr))
>> {
>> //log error
>> }
>>
>> What causes a MAPI_E_CALL_FAILED for IMessageStore::OpenEntry
>>
>> thanks
>>
>>
>>
>>
>
> -- 
> Regards,
> Ashutosh Bhawasinka
> email: discussion@ashutosh.in
> MCSA - Messaging,
> MCTS - .Net Windows Apps
date: Tue, 29 Jul 2008 17:06:04 -0500   author:   Scott McFadden

Re: MAPI_E_CALL_FAILED ?   
Also, I see this in the exchange server log after the OpenEntry failure:

Mapi session "/o=ACME Inc./ou=AC/cn=Recipients/cn=FOTNUser" exceeded the 
maximum of 250 objects of type "objtMessage"



"Ashutosh" <smbs-msdn@nospam.nospam> wrote in message 
news:OvGawsb8IHA.1200@TK2MSFTNGP04.phx.gbl...
> Open it through the folder interface!! If you try to open the message 
> through the store interface, the store provider is not always able to 
> locate the message!
>
> Just imagine how much work the store provider has do if you call OpenEntry 
> without specifying the type or interface, it has search each and every 
> item that exist in the store, be it folder, message, or other special 
> things.
>
> Scott McFadden wrote:
>> Recently, I noticed that the message store OpenEntry code fails with 
>> MAPI_E_CALL_FAILED  when opening mails on a certain exchange 2003 server. 
>> This does not happen on other exchange servers for which the same code is 
>> running.
>>
>> ULONG uObjType = 0;
>> LPMESSAGE pMessage = NULL;
>>
>> hr = pMsgStore->OpenEntry(entryId->cb, (LPENTRYID)entryId->lpb, NULL, 
>> MAPI_BEST_ACCESS, &uObjType, (LPUNKNOWN FAR *)&pMessage);
>> if (FAILED(hr))
>> {
>> //log error
>> }
>>
>> What causes a MAPI_E_CALL_FAILED for IMessageStore::OpenEntry
>>
>> thanks
>>
>>
>>
>>
>
> -- 
> Regards,
> Ashutosh Bhawasinka
> email: discussion@ashutosh.in
> MCSA - Messaging,
> MCTS - .Net Windows Apps
date: Tue, 29 Jul 2008 17:17:17 -0500   author:   Scott McFadden

Re: MAPI_E_CALL_FAILED ?   
Hi Ashutosh,

>> Recently, I noticed that the message store OpenEntry code fails with
>> MAPI_E_CALL_FAILED  when opening mails on a certain exchange 2003
>> server. This does not happen on other exchange servers for which the
>> same code is running.
>
> Open it through the folder interface!! If you try to open the message
> through the store interface, the store provider is not always able to
> locate the message!
>
> Just imagine how much work the store provider has do if you call
> OpenEntry without specifying the type or interface, it has search each
> and every item that exist in the store, be it folder, message, or
> other special things.

I am pretty sure that using the entryid to open an item from a store is a
direct access no matter what folder it is in. There is no need for searching
and I doubt that you can measure any difference in speed calling OpenEntry
on IMsgStore or IMAPIFolder.

The OPs problem will likely be a leak in his interface pointer usage: too
many open items.

--
SvenC
date: Wed, 30 Jul 2008 07:52:59 +0200   author:   SvenC am

Re: MAPI_E_CALL_FAILED ?   
Hi Scott,

> I did notice that it magically happens after 250 emails have been
> processed. I am dilgent to release the IMessage so not sure what the
> resource leak is. 

Please show us your code how you store and release your IMessage
interface pointers.

A wild guess: when using smart pointers you can easily reuse a pointer
without releasing the current instance by using the address operator:

CComPtr<IMessage> spMsg;
hr = spStore->OpenEntry(..., (IUnknown**)&spMsg);

// when you use &spMsg again, the current instance is not releases
hr = spStore->OpenEntry(..., (IUnknown**)&spMsg);
// the above line leaked the first message item

// always do this:
spMsg = NULL;
hr = spStore->OpenEntry(..., (IUnknown**)&spMsg);


Another common error might be to store too many items in some
container. Store the entryids instead.

--
SvenC
date: Wed, 30 Jul 2008 07:58:04 +0200   author:   SvenC am

Re: MAPI_E_CALL_FAILED ?   
"Ashutosh" <smbs-msdn@nospam.nospam> wrote in message 
news:OvGawsb8IHA.1200@TK2MSFTNGP04.phx.gbl...
|
| Just imagine how much work the store provider has do if you call
| OpenEntry without specifying the type or interface, it has search each
| and every item that exist in the store, be it folder, message, or other
| special things.


Ashutosh,
I think that this is absolutely wrong. Typically ENTRYID is composed binary. 
For example, first two bytes can pointed to version of MsgStore, next two 
bytes - type of object (Folder, Message, etc..), next 16 bytes - UID of 
parent object, next 16 bytes - UID of same object. Regarding unique 
implementation of MsgStore, ENTRYID structure of course can be different. 
But MsgStore, in most of cases, never search thru all existing objects. Lets 
we imagine, that objects are stored to SQL database and ENTRYID is equal to 
1103123456890, where 11 is version, 03 is object type, and 1234567890 is 
object UID. Then MsgStore interface (some hypothetic implementation), will 
construct this SQL query:
SELECT OBJECT_PROPERTIES FROM OBJECT_TABLE WHERE OBJECT_TYPE=3 AND 
UID=1234567890

And if operation is succeeded, will return IMessage interface.

IvanK,
www.imibo.com
date: Wed, 30 Jul 2008 09:13:30 +0300   author:   IvanK

Re: MAPI_E_CALL_FAILED ?   
Well I must say that I don't know how the entry ID is composed. But I 
have seen cases(sometimes) of failure when trying to open the message 
through the store interface (also session). So, that was nothing of 
concept, but just practical observation.

Hope Dmitry or someone else from MS put some light on it :)
IvanK wrote:
> "Ashutosh" <smbs-msdn@nospam.nospam> wrote in message 
> news:OvGawsb8IHA.1200@TK2MSFTNGP04.phx.gbl...
> |
> | Just imagine how much work the store provider has do if you call
> | OpenEntry without specifying the type or interface, it has search each
> | and every item that exist in the store, be it folder, message, or other
> | special things.
>
>
> Ashutosh,
> I think that this is absolutely wrong. Typically ENTRYID is composed binary. 
> For example, first two bytes can pointed to version of MsgStore, next two 
> bytes - type of object (Folder, Message, etc..), next 16 bytes - UID of 
> parent object, next 16 bytes - UID of same object. Regarding unique 
> implementation of MsgStore, ENTRYID structure of course can be different. 
> But MsgStore, in most of cases, never search thru all existing objects. Lets 
> we imagine, that objects are stored to SQL database and ENTRYID is equal to 
> 1103123456890, where 11 is version, 03 is object type, and 1234567890 is 
> object UID. Then MsgStore interface (some hypothetic implementation), will 
> construct this SQL query:
> SELECT OBJECT_PROPERTIES FROM OBJECT_TABLE WHERE OBJECT_TYPE=3 AND 
> UID=1234567890
>
> And if operation is succeeded, will return IMessage interface.
>
> IvanK,
> www.imibo.com 
>
>
>
date: Wed, 30 Jul 2008 13:54:45 +0530   author:   Ashutosh am

Re: MAPI_E_CALL_FAILED ?   
Now that you posted such comments, I will have to test my application 
with so many mails in exchange mailbox!!! But I have tested my 
application with around 3600 messages(most of then containing large 
attachments) in a PST and my application works perfectly without any 
problem (& no memory leaks :-) )

I will try it with exchange mailbox and see if there is any limit & let 
you know. But I can't be sure of time it will take :)

-- 
Regards,
Ashutosh Bhawasinka
email: discussion@ashutosh.in
MCSA - Messaging,
MCTS - .Net Windows Apps


Scott McFadden wrote:
> Also, I see this in the exchange server log after the OpenEntry failure:
>
> Mapi session "/o=ACME Inc./ou=AC/cn=Recipients/cn=FOTNUser" exceeded the 
> maximum of 250 objects of type "objtMessage"
>
>
>
> "Ashutosh" <smbs-msdn@nospam.nospam> wrote in message 
> news:OvGawsb8IHA.1200@TK2MSFTNGP04.phx.gbl...
>   
>> Open it through the folder interface!! If you try to open the message 
>> through the store interface, the store provider is not always able to 
>> locate the message!
>>
>> Just imagine how much work the store provider has do if you call OpenEntry 
>> without specifying the type or interface, it has search each and every 
>> item that exist in the store, be it folder, message, or other special 
>> things.
>>
>> Scott McFadden wrote:
>>     
>>> Recently, I noticed that the message store OpenEntry code fails with 
>>> MAPI_E_CALL_FAILED  when opening mails on a certain exchange 2003 server. 
>>> This does not happen on other exchange servers for which the same code is 
>>> running.
>>>
>>> ULONG uObjType = 0;
>>> LPMESSAGE pMessage = NULL;
>>>
>>> hr = pMsgStore->OpenEntry(entryId->cb, (LPENTRYID)entryId->lpb, NULL, 
>>> MAPI_BEST_ACCESS, &uObjType, (LPUNKNOWN FAR *)&pMessage);
>>> if (FAILED(hr))
>>> {
>>> //log error
>>> }
>>>
>>> What causes a MAPI_E_CALL_FAILED for IMessageStore::OpenEntry
>>>
>>> thanks
>>>
>>>
>>>
>>>
>>>       
>> -- 
>> Regards,
>> Ashutosh Bhawasinka
>> email: discussion@ashutosh.in
>> MCSA - Messaging,
>> MCTS - .Net Windows Apps 
>>     
>
>
>
date: Wed, 30 Jul 2008 14:00:17 +0530   author:   Ashutosh Bhawasinka

Re: MAPI_E_CALL_FAILED ?   
Just tested my application with 3588 messages (around 400 MB in size) in 
a exchange 2003 mailbox. The application for test, opened every message 
and did some processing on it. The application ran without any problem.

So, by default there is no limit on the exchange server. Looks like your 
exchange admin has configured something. I will try to find out the 
settings if possible.

Also from your post its clear that there is a limit set. So, in that 
case you have only one option (if you can't change server settings) to 
logoff the session and login again.

-- 
Regards,
Ashutosh Bhawasinka
email: discussion@ashutosh.in
MCSA - Messaging,
MCTS - .Net Windows Apps


Ashutosh Bhawasinka wrote:
> Now that you posted such comments, I will have to test my application 
> with so many mails in exchange mailbox!!! But I have tested my 
> application with around 3600 messages(most of then containing large 
> attachments) in a PST and my application works perfectly without any 
> problem (& no memory leaks :-) )
>
> I will try it with exchange mailbox and see if there is any limit & 
> let you know. But I can't be sure of time it will take :)
> -- 
> Regards,
> Ashutosh Bhawasinka
> email: discussion@ashutosh.in
> MCSA - Messaging,
> MCTS - .Net Windows Apps
>
> Scott McFadden wrote:
>> Also, I see this in the exchange server log after the OpenEntry failure:
>>
>> Mapi session "/o=ACME Inc./ou=AC/cn=Recipients/cn=FOTNUser" exceeded the 
>> maximum of 250 objects of type "objtMessage"
>>
>>
>>
>> "Ashutosh" <smbs-msdn@nospam.nospam> wrote in message 
>> news:OvGawsb8IHA.1200@TK2MSFTNGP04.phx.gbl...
>>   
>>> Open it through the folder interface!! If you try to open the message 
>>> through the store interface, the store provider is not always able to 
>>> locate the message!
>>>
>>> Just imagine how much work the store provider has do if you call OpenEntry 
>>> without specifying the type or interface, it has search each and every 
>>> item that exist in the store, be it folder, message, or other special 
>>> things.
>>>
>>> Scott McFadden wrote:
>>>     
>>>> Recently, I noticed that the message store OpenEntry code fails with 
>>>> MAPI_E_CALL_FAILED  when opening mails on a certain exchange 2003 server. 
>>>> This does not happen on other exchange servers for which the same code is 
>>>> running.
>>>>
>>>> ULONG uObjType = 0;
>>>> LPMESSAGE pMessage = NULL;
>>>>
>>>> hr = pMsgStore->OpenEntry(entryId->cb, (LPENTRYID)entryId->lpb, NULL, 
>>>> MAPI_BEST_ACCESS, &uObjType, (LPUNKNOWN FAR *)&pMessage);
>>>> if (FAILED(hr))
>>>> {
>>>> //log error
>>>> }
>>>>
>>>> What causes a MAPI_E_CALL_FAILED for IMessageStore::OpenEntry
>>>>
>>>> thanks
>>>>
>>>>
>>>>
>>>>
>>>>       
>>> -- 
>>> Regards,
>>> Ashutosh Bhawasinka
>>> email: discussion@ashutosh.in
>>> MCSA - Messaging,
>>> MCTS - .Net Windows Apps 
>>>     
>>
>>
>>
date: Wed, 30 Jul 2008 15:09:13 +0530   author:   Ashutosh Bhawasinka

Re: MAPI_E_CALL_FAILED ?   
Hi Ashutosh,

> Just tested my application with 3588 messages (around 400 MB in size)
> in a exchange 2003 mailbox. The application for test, opened every
> message and did some processing on it. The application ran without
> any problem.
>
> So, by default there is no limit on the exchange server. Looks like your
> exchange admin has configured something. I will try to find out the
> settings if possible.

But you do release each IMessage and IMAPIFolder object as soon as
you are done with it, correct? You do not have more than 250 or 255
(not sure about the real limit) objects open at the same time, correct?

My guess is that Scott is missing some Release calls or missuses the
help of smart pointer classes.

--
SvenC
date: Wed, 30 Jul 2008 11:59:17 +0200   author:   SvenC am

Re: MAPI_E_CALL_FAILED ?   
Please ignore my last post!

Yes your are correct!! that message occurs when that many objects are 
open at a time!! So, I am sure the message interfaces are not release.

SvenC wrote:
> Hi Ashutosh,
>
>> Just tested my application with 3588 messages (around 400 MB in size)
>> in a exchange 2003 mailbox. The application for test, opened every
>> message and did some processing on it. The application ran without
>> any problem.
>>
>> So, by default there is no limit on the exchange server. Looks like your
>> exchange admin has configured something. I will try to find out the
>> settings if possible.
>
> But you do release each IMessage and IMAPIFolder object as soon as
> you are done with it, correct? You do not have more than 250 or 255
> (not sure about the real limit) objects open at the same time, correct?
>
> My guess is that Scott is missing some Release calls or missuses the
> help of smart pointer classes.
>
> -- 
> SvenC
date: Wed, 30 Jul 2008 15:45:43 +0530   author:   Ashutosh Bhawasinka

Re: MAPI_E_CALL_FAILED ?   
Ok, did some more migrane inducing research and discovered that my smart 
pointer IMessage release code worked fine in VC2005 but when ported over to 
VC2008 it no longer works (does compile however).  So its a definate smart 
pointer / VC2008 issue.  I ditched the IMessage smart pointer and all is 
well now.

thanks for the help.



"SvenC" <SvenC@nospam.nospam> wrote in message 
news:0C780F01-A069-4C05-84AC-39CB9BB315C8@microsoft.com...
> Hi Ashutosh,
>
>> Just tested my application with 3588 messages (around 400 MB in size)
>> in a exchange 2003 mailbox. The application for test, opened every
>> message and did some processing on it. The application ran without
>> any problem.
>>
>> So, by default there is no limit on the exchange server. Looks like your
>> exchange admin has configured something. I will try to find out the
>> settings if possible.
>
> But you do release each IMessage and IMAPIFolder object as soon as
> you are done with it, correct? You do not have more than 250 or 255
> (not sure about the real limit) objects open at the same time, correct?
>
> My guess is that Scott is missing some Release calls or missuses the
> help of smart pointer classes.
>
> --
> SvenC
date: Wed, 30 Jul 2008 10:19:43 -0500   author:   Scott McFadden

Re: MAPI_E_CALL_FAILED ?   
I think you are mixing IMAPISession;;OpenEntry with IMsgStore::OpenEntry.
The former one can fail if the parent store has never been opened in the 
current session and MAPI does not know which store is responsible for it.
There is no difference between IMsgStore::OpenEntry and 
IMAPIFolder::OpenEntry unless IMsgStore is cached and IMAPIFolder is online.

-- 
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool
-
"Ashutosh" <smbs-msdn@nospam.nospam> wrote in message 
news:%237qH92h8IHA.3724@TK2MSFTNGP03.phx.gbl...
> Well I must say that I don't know how the entry ID is composed. But I have 
> seen cases(sometimes) of failure when trying to open the message through 
> the store interface (also session). So, that was nothing of concept, but 
> just practical observation.
>
> Hope Dmitry or someone else from MS put some light on it :)
> IvanK wrote:
>> "Ashutosh" <smbs-msdn@nospam.nospam> wrote in message 
>> news:OvGawsb8IHA.1200@TK2MSFTNGP04.phx.gbl...
>> |
>> | Just imagine how much work the store provider has do if you call
>> | OpenEntry without specifying the type or interface, it has search each
>> | and every item that exist in the store, be it folder, message, or other
>> | special things.
>>
>>
>> Ashutosh,
>> I think that this is absolutely wrong. Typically ENTRYID is composed 
>> binary. For example, first two bytes can pointed to version of MsgStore, 
>> next two bytes - type of object (Folder, Message, etc..), next 16 bytes - 
>> UID of parent object, next 16 bytes - UID of same object. Regarding 
>> unique implementation of MsgStore, ENTRYID structure of course can be 
>> different. But MsgStore, in most of cases, never search thru all existing 
>> objects. Lets we imagine, that objects are stored to SQL database and 
>> ENTRYID is equal to 1103123456890, where 11 is version, 03 is object 
>> type, and 1234567890 is object UID. Then MsgStore interface (some 
>> hypothetic implementation), will construct this SQL query:
>> SELECT OBJECT_PROPERTIES FROM OBJECT_TABLE WHERE OBJECT_TYPE=3 AND 
>> UID=1234567890
>>
>> And if operation is succeeded, will return IMessage interface.
>>
>> IvanK,
>> www.imibo.com
>>
>>
date: Wed, 30 Jul 2008 09:45:13 -0700   author:   Dmitry Streblechenko

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us