A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

CompareEntryIDs is returning bogus results



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 18th 07, 07:47 PM posted to microsoft.public.outlook.program_addins
Count Infinity
external usenet poster
 
Posts: 3
Default CompareEntryIDs is returning bogus results

Under certain situations I want to test for the existence of certain messages
in the store for which I have an entry ID (so I can iterate through a list,
and remove anything that doesn't exist anymore.) I tried the following:

if (m_pSession-CompareEntryIDs(id.cb, (LPENTRYID)id.lpb, id.cb,
(LPENTRYID)id.lpb, 0, &ul) != MAPI_E_UNKNOWN_ENTRYID)
{
// This code should only execute if the ID is not valid...right?
}

Notice that I compare the id against itself. I would expect this to always
return S_OK unless the id was not valid. This seemed to work on my computer,
however, in testing we found at least one computer where CompareEntryIDs was
returning MAPI_E_UNKNOWN_ENTRYID around 50% of the time, even when id
contained a valid entryid. The computer in question was a tablet PC running
XP SP2 and Outlook 2003 w/ Exchange Server 2003.

I don't need a workaround, I have another solution in place for now. My
question is WHY this function would fail so badly on perhaps the easiest
possible case. I need to know, since I obviously have to use CompareEntryIDs
for more normal things. Any ideas?
Ads
  #2  
Old October 18th 07, 08:12 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default CompareEntryIDs is returning bogus results

Because it does not know which provider is supposed to handle that
particular entry id?
Does the entry id come from a store that you have never touched in teh
current MAPI session?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Count Infinity" wrote in message
...
Under certain situations I want to test for the existence of certain
messages
in the store for which I have an entry ID (so I can iterate through a
list,
and remove anything that doesn't exist anymore.) I tried the following:

if (m_pSession-CompareEntryIDs(id.cb, (LPENTRYID)id.lpb, id.cb,
(LPENTRYID)id.lpb, 0, &ul) != MAPI_E_UNKNOWN_ENTRYID)
{
// This code should only execute if the ID is not valid...right?
}

Notice that I compare the id against itself. I would expect this to always
return S_OK unless the id was not valid. This seemed to work on my
computer,
however, in testing we found at least one computer where CompareEntryIDs
was
returning MAPI_E_UNKNOWN_ENTRYID around 50% of the time, even when id
contained a valid entryid. The computer in question was a tablet PC
running
XP SP2 and Outlook 2003 w/ Exchange Server 2003.

I don't need a workaround, I have another solution in place for now. My
question is WHY this function would fail so badly on perhaps the easiest
possible case. I need to know, since I obviously have to use
CompareEntryIDs
for more normal things. Any ideas?



  #3  
Old October 18th 07, 08:31 PM posted to microsoft.public.outlook.program_addins
Count Infinity
external usenet poster
 
Posts: 3
Default CompareEntryIDs is returning bogus results

Actually no. The entry id in every case is for a message that I already
opened at one point, read, and used information from to populate a list. The
software operates across several stores, so the stores are all kept open.
Therefore, in the current session, the store is open, and has been used to
open this particular message at least once.

Further testing reveals that the following also fails:
CMAPIMessage msg; // internal class to encapsulate this
if (!msg.Open(&mapi, id, 0))
{
// open failed
}
else if (m_pSession-CompareEntryIDs(id.cb, (LPENTRYID)id.lpb, id.cb,
(LPENTRYID)id.lpb, 0, &ul) == MAPI_E_UNKNOWN_ENTRYID)
{
// In theory the entry id should not exist if we get here...
}
msg.Close();


"Dmitry Streblechenko" wrote:

Because it does not know which provider is supposed to handle that
particular entry id?
Does the entry id come from a store that you have never touched in teh
current MAPI session?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Count Infinity" wrote in message
...
Under certain situations I want to test for the existence of certain
messages
in the store for which I have an entry ID (so I can iterate through a
list,
and remove anything that doesn't exist anymore.) I tried the following:

if (m_pSession-CompareEntryIDs(id.cb, (LPENTRYID)id.lpb, id.cb,
(LPENTRYID)id.lpb, 0, &ul) != MAPI_E_UNKNOWN_ENTRYID)
{
// This code should only execute if the ID is not valid...right?
}

Notice that I compare the id against itself. I would expect this to always
return S_OK unless the id was not valid. This seemed to work on my
computer,
however, in testing we found at least one computer where CompareEntryIDs
was
returning MAPI_E_UNKNOWN_ENTRYID around 50% of the time, even when id
contained a valid entryid. The computer in question was a tablet PC
running
XP SP2 and Outlook 2003 w/ Exchange Server 2003.

I don't need a workaround, I have another solution in place for now. My
question is WHY this function would fail so badly on perhaps the easiest
possible case. I need to know, since I obviously have to use
CompareEntryIDs
for more normal things. Any ideas?




  #4  
Old October 19th 07, 12:33 AM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default CompareEntryIDs is returning bogus results

I can only suspect memory corruption of some kind. Try to output the valeu
of the entry id.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Count Infinity" wrote in message
...
Actually no. The entry id in every case is for a message that I already
opened at one point, read, and used information from to populate a list.
The
software operates across several stores, so the stores are all kept open.
Therefore, in the current session, the store is open, and has been used to
open this particular message at least once.

Further testing reveals that the following also fails:
CMAPIMessage msg; // internal class to encapsulate this
if (!msg.Open(&mapi, id, 0))
{
// open failed
}
else if (m_pSession-CompareEntryIDs(id.cb, (LPENTRYID)id.lpb, id.cb,
(LPENTRYID)id.lpb, 0, &ul) == MAPI_E_UNKNOWN_ENTRYID)
{
// In theory the entry id should not exist if we get here...
}
msg.Close();


"Dmitry Streblechenko" wrote:

Because it does not know which provider is supposed to handle that
particular entry id?
Does the entry id come from a store that you have never touched in teh
current MAPI session?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Count Infinity" wrote in
message
...
Under certain situations I want to test for the existence of certain
messages
in the store for which I have an entry ID (so I can iterate through a
list,
and remove anything that doesn't exist anymore.) I tried the following:

if (m_pSession-CompareEntryIDs(id.cb, (LPENTRYID)id.lpb, id.cb,
(LPENTRYID)id.lpb, 0, &ul) != MAPI_E_UNKNOWN_ENTRYID)
{
// This code should only execute if the ID is not valid...right?
}

Notice that I compare the id against itself. I would expect this to
always
return S_OK unless the id was not valid. This seemed to work on my
computer,
however, in testing we found at least one computer where
CompareEntryIDs
was
returning MAPI_E_UNKNOWN_ENTRYID around 50% of the time, even when id
contained a valid entryid. The computer in question was a tablet PC
running
XP SP2 and Outlook 2003 w/ Exchange Server 2003.

I don't need a workaround, I have another solution in place for now. My
question is WHY this function would fail so badly on perhaps the
easiest
possible case. I need to know, since I obviously have to use
CompareEntryIDs
for more normal things. Any ideas?






  #5  
Old October 19th 07, 02:19 AM posted to microsoft.public.outlook.program_addins
Count Infinity
external usenet poster
 
Posts: 3
Default CompareEntryIDs is returning bogus results

Well, the fact that the open accurately retrieves the record tends to speak
against a corrupt id theory.

I do feel better, however, knowing that this confuses the leading expert in
all things MAPI, not just me.

"Dmitry Streblechenko" wrote:

I can only suspect memory corruption of some kind. Try to output the valeu
of the entry id.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Count Infinity" wrote in message
...
Actually no. The entry id in every case is for a message that I already
opened at one point, read, and used information from to populate a list.
The
software operates across several stores, so the stores are all kept open.
Therefore, in the current session, the store is open, and has been used to
open this particular message at least once.

Further testing reveals that the following also fails:
CMAPIMessage msg; // internal class to encapsulate this
if (!msg.Open(&mapi, id, 0))
{
// open failed
}
else if (m_pSession-CompareEntryIDs(id.cb, (LPENTRYID)id.lpb, id.cb,
(LPENTRYID)id.lpb, 0, &ul) == MAPI_E_UNKNOWN_ENTRYID)
{
// In theory the entry id should not exist if we get here...
}
msg.Close();


"Dmitry Streblechenko" wrote:

Because it does not know which provider is supposed to handle that
particular entry id?
Does the entry id come from a store that you have never touched in teh
current MAPI session?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Count Infinity" wrote in
message
...
Under certain situations I want to test for the existence of certain
messages
in the store for which I have an entry ID (so I can iterate through a
list,
and remove anything that doesn't exist anymore.) I tried the following:

if (m_pSession-CompareEntryIDs(id.cb, (LPENTRYID)id.lpb, id.cb,
(LPENTRYID)id.lpb, 0, &ul) != MAPI_E_UNKNOWN_ENTRYID)
{
// This code should only execute if the ID is not valid...right?
}

Notice that I compare the id against itself. I would expect this to
always
return S_OK unless the id was not valid. This seemed to work on my
computer,
however, in testing we found at least one computer where
CompareEntryIDs
was
returning MAPI_E_UNKNOWN_ENTRYID around 50% of the time, even when id
contained a valid entryid. The computer in question was a tablet PC
running
XP SP2 and Outlook 2003 w/ Exchange Server 2003.

I don't need a workaround, I have another solution in place for now. My
question is WHY this function would fail so badly on perhaps the
easiest
possible case. I need to know, since I obviously have to use
CompareEntryIDs
for more normal things. Any ideas?






 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Close method returning 80040108 Michael Tissington Add-ins for Outlook 4 February 14th 07 12:03 AM
WDS not returning Office 2007 emails on Windows XP BerkHolz, Steven Outlook - General Queries 5 January 12th 07 07:28 PM
Bogus error message when sending large files. William G. Davis Outlook Express 2 June 26th 06 08:56 PM
deleted emails returning David Outlook - General Queries 0 March 30th 06 05:09 PM
Old Reminders Keep Returning Anita Taylor Outlook - Calandaring 0 March 9th 06 03:11 PM


All times are GMT +1. The time now is 09:25 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.