OnConnection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have a problem with my add-in, that some simple OOM or MAPI functions fail
in the context of the OnConnection event - my add-in inherited from the
_IDTExtensibility2.
As an example, the GetFolderFromID() function throws a_com_error exception
with unknown error( 0x96a40107 ). This occur with some folders in a PST.
Other folders and other PSTs don't have this problem.
The same function succeeded when I call it with the same EntryID & StoreID
but after leaving the context of the OnConnection event.
Now, simply, the question is, does all the PSTs loaded completely before
linking (calling OnConnection)with the add-ins?!!!
 
Use OnStartupComplete callback instead - by the time it is executed, Outlook
already has a valid MAPI session.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Hello Dmitry,
I tried it and unfortunately it didn't work!!!
I think that my MAPI session already valid... The problem doesn't exist with
the two default PSTs (Personal&Archive).. but it is valid with another PST
that I added to the outlook... when I call the GetFolderFromID for any folder
it it within the OnConnection or OnStartupComplete; the exception triggered.
But when I call the GetFolderFromID of the same parameters within a call to a
button I added to the Outlook toolbar, the function succeedeed.
I think that this is one of many of the strange behaviors of the Outlook.

Thanks.
 
Do you specify *both* the folder and the store entry ids when calling
GetFolderFromID?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
The error looks like MAPI_E_INVALID_ENTRYID. Are you absolutely, 100%, sure
that the entry ids belong to a store that exists in the current session?
Where do these values come from?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
I'm shocked just like you...
Yes 100%... I'm getting the StoreID and EntryID by looping for all PSTs and
sub folders. And to be sure, I copied the StoreID and EntryID from the
Outlook Spy -GREAT PRODUCT- and used them as constants(GetFolderFromID(
"xxx", "xxxxxx"), and the same error exist with this strange PST when calling
from OnConnection or OnStartupComp. And I used the same call to
GetFolderFromID in a handler for a button, and it succeeded.
 
So it only happens for one particular PST, not for any other PST or mailbox,
right?
Is there anything different about that PST?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Yes, one PST, and not always :)
There is nothing different in this PST, unless it was empty, but I put some
mails in it and the same problem still. On another testing machine, the same
problem found with an OST file.
 
No at all.
I left this issue now, and when I find anything new, I'll inform you.
Now, I have new questions and I'll put every question in a separated thread.
Thanks Dmitry.
 
Back
Top