Failed to delete more than 512 messages for one session

8 views
Skip to first unread message

llahani

unread,
Sep 28, 2009, 7:16:05 AM9/28/09
to Nektra OEAPI Support
First of all, sorry for my clumsy english.

Preface: Outlook Express/DLL-Plugin/Nektra OEAPI v3.2.3 Enterprise

- The problem is, I'm trying to delete great number of messages from
dll plugin. Everything is going fine, while not magic number to 512
reached. It doesn't matter where messages deleted consecutively or
delete operations are interleaved with any other operations. Also, it
doesn't matter were messages deleted by means of
IOEFolder::DeleteMessage method or IOEMessage::Delete method. Once
limit to 512 messages for one session is reached, either method fail.
To the moment the only one solution is to restart Outlook Express. You
understand, it will be hard to explain end-user to restart Outlook
Express every time as 512 messages were deleted =) So, any help will
be much appreciated!

- MoveMessage from 'Deleted Items' folder also have above-mentioned
limitation.

Actually, there is another one workaround. It is possible to create
temporary folder in 'Deleted Items'. And to work with it, rather than
with 'Deleted Items' itself. Not to delete messages directly, but to
move them to temporary folder. And on shutdown to delete temporary
folder. Slightly modified, this workaround was used for Windows Mail,
as Windows Mail sometimes fail to delete message permanently.

P.S. Nevertheless, Your library is really good ;)

llahani

unread,
Sep 29, 2009, 6:21:27 AM9/29/09
to Nektra OEAPI Support
Sample code to reproduce the problem.

Slightly modified 'C++ ATL Demo'

//-----------------------------------------------------------------------------------------------------------------------
const size_t MAX_MESSAGES_IN_BATCH = 50;

//-----------------------------------------------------------------------------------------------------------------------
// Auxiliary function
#include <vector>
typedef std::vector<long> SelectedItemIDs;

long GetSelectedItemIDs(const CComPtr<IOEAPIObj> &oeapi,
SelectedItemIDs *selectedItemIDs)
{
long currentFolderID = oeapi->GetSelectedFolderID();

bool shouldCheckCurrentMessage = true;
if (oeapi->IsAnyMessageSelected() != FALSE) {
long messageID = oeapi->GetFirstSelectedMessageID();
if (messageID != -1) {
shouldCheckCurrentMessage = false;
while (messageID != -1) {
selectedItemIDs->push_back(messageID);
messageID = oeapi->GetNextSelectedMessageID();
}
}
}

if (shouldCheckCurrentMessage) {
long messageID = oeapi->GetCurrentMessageID();
if (messageID != -1)
selectedItemIDs->push_back(messageID);
}

return currentFolderID;
}

llahani

unread,
Sep 29, 2009, 6:22:34 AM9/29/09
to Nektra OEAPI Support
//-----------------------------------------------------------------------------------------------------------------------
STDMETHODIMP Catl_addin::OnToolbarButtonClicked(long toolbarId, long
buttonId)
{
try
{
if(m_toolbarId == toolbarId && buttonId == m_showHelp)
{
IOEFolderManagerPtr folderManager(__uuidof(OEFolderManager));

SelectedItemIDs selectedItemIDs;
long currentFolderID = GetSelectedItemIDs(m_oeapi,
&selectedItemIDs);

IOEFolderPtr currentFolder = folderManager->GetFolder
(currentFolderID);
for (size_t i = 0, i_end = selectedItemIDs.size(); i < i_end && i <
MAX_MESSAGES_IN_BATCH; ++i)
currentFolder->DeleteMessage(selectedItemIDs[i], FALSE);
}
}
catch (...)
{}

return S_OK;
}


Error checking was omitted for clarity. Heavy-weight operation in the
same thread for the same reason.
There is artificial parameter 'MAX_MESSAGES_IN_BATCH', otherwise
Outlook Express hangs or even crashes.

There is another one flaw. And this one is more serious. Sometimes it
is possible to delete more than 512 messages.
But then, messages that exceeded magic limit but were successfully
deleted become unaccessible:

Nektra OEAPI Support

unread,
Sep 30, 2009, 12:44:36 PM9/30/09
to nektra...@googlegroups.com
Hi Llahani,

We have verified problems when moving a large amount of messages (When
deleting non permanently, messages get moved to Deleted Items).
For now we have verified this after moving over 1500 messages in our tests.

We will need time to make research and analyze this issue.

Thank you for your detailed report.

> P.S. Nevertheless, Your library is really good
Thanks, your comment makes us glad!

Regards,

Federico
--
Nektra Advanced Computing
http://www.nektra.com

llahani

unread,
Oct 5, 2009, 7:57:42 AM10/5/09
to Nektra OEAPI Support
Hi, Federico.

I'm glad to hear your reply.
To the moment we decided to restrict the number of operations with
'Deleted Items' to 512.

Hope, this issue will be successfully solved.

With best regards,
llahani.

llahani

unread,
Oct 14, 2009, 11:17:45 AM10/14/09
to Nektra OEAPI Support
Hi, Federico.

Any good news on the problem?

With best regards,
llahani.

Nektra OEAPI Support

unread,
Oct 15, 2009, 8:48:10 AM10/15/09
to nektra...@googlegroups.com
Hi llahani,

We have no news yet, we'll need time to analyze this issue.

Thank you for contacting Nektra's OEAPI Support.

Regards,

Federico

--
Nektra Advanced Computing
http://www.nektra.com



llahani

unread,
Oct 19, 2009, 11:35:08 AM10/19/09
to Nektra OEAPI Support
Good news, Federico.

Finally the problem was solved. There is still another one question:
how I can contact with you in order to commit fix?

With best regards,
llahani.

Nektra OEAPI Support

unread,
Oct 20, 2009, 12:03:07 PM10/20/09
to nektra...@googlegroups.com, Nektra OEAPI Support
Hi Llahani,

Please write directly to this OEAPI Support at Nektra email address to
discuss this issue.

Thank you for contacting Nektra's OEAPI Support.

Regards,

Federico

--
Nektra Advanced Computing
http://www.nektra.com




llahani wrote:
Reply all
Reply to author
Forward
0 new messages