About TMAS_OEStore::IOEFolderManager::GetNextFolder function in Windows mail on Vista platform

0 views
Skip to first unread message

David

unread,
Mar 28, 2008, 1:45:08 AM3/28/08
to Nektra OEAPI Support
Dears:
A problem occurs in my application about
IOEFolderManager::GetNextFolder function. My application create 2
threads to get the spam mail folder in Windows mail. The main thread
can get the right spam folder. But another main thread can not get it.
Their code is most same.
The code in main thread:
com_ptr<TMAS_OEStore::IOEFolder> spFolder= m_spFolderMgr-
>GetFirstFolder();
bool bExist= false;
long lRootId= 0;
while(!spFolder.is_null()) {
CString strName= spFolder->Name().t_str().c_str();
if(strName == SPAMBUSTER_SPAMMAIL_FOLDERNAME) {
m_spSpamMail= spFolder;
bExist= true;
break;
} else if (strName == "Local Folders") {
lRootId= spFolder->GetID();
}
spFolder = m_spFolderMgr->GetNextFolder();
}
if (!bExist) {
CDebugMsg::Trace("@@@ Creating spam mail folder ...");
m_spSpamMail= m_spFolderMgr->CreateFolder(lRootId,
SPAMBUSTER_SPAMMAIL_FOLDERNAME);
CDebugMsg::Trace("@@@ spam mail folder was created.");
}


The code in another work thread:
spMailScanInfSet->spFolderMgr=
TMAS_OEStore::OEFolderManager::create();
CDebugMsg::Trace("Get the spam folder interface");
com_ptr<TMAS_OEStore::IOEFolder> spFolder= (spMailScanInfSet-
>spFolderMgr)->GetFirstFolder();
while(!spFolder.is_null()) {
CString strName= spFolder->Name().t_str().c_str();
if(strName == SPAMBUSTER_SPAMMAIL_FOLDERNAME) {
spMailScanInfSet->spSpamMail= spFolder;
break;
}
spFolder = (spMailScanInfSet->spFolderMgr)->GetNextFolder();
}

This case just happen in windows mail on vista platform. For
outlook express, it works well. And it seems that
IOEFolder::GetFirstMessage in other thead also has the same
problem(Always get null pointer). could you help me?

BRS
David

Nektra OEAPI Support

unread,
Apr 1, 2008, 5:21:44 PM4/1/08
to Nektra...@googlegroups.com
Hi David:

Sorry about the delay but we are still currently making research about
this issue. It could help if you could send us a sample project ready to
compile and test this issue.
We'll contact again when we have any news about it.

Thank you for contacting Nektra's OEAPI Support.

Regards,

Federico

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

Nektra OEAPI Support

unread,
Apr 8, 2008, 4:09:13 PM4/8/08
to Nektra...@googlegroups.com
Hi David:

Please try creating OEFolderManager/OEFolder/OEMessage in each thread
(instead of, for example, creating an OEFolderManager in the main thread
and calling it from the other threads).

It seems the problem is that under Windows Mail you cannot share objects
across threads. If you need to exchange information across threads you
should use the folderId, messageId, etc.

David

unread,
Apr 9, 2008, 2:06:43 AM4/9/08
to Nektra OEAPI Support
Dear Federico:
Sorry to reply it late. Thanks for your information. Actually, i
create the OEFolderManager/OEFolder/OEMessage in each thread in my
code because the COM thread model is "Apartment". But it still can not
work.

BRs
JunLu

On Apr 9, 4:09 am, Nektra OEAPI Support <oeapi-supp...@nektra.com>
wrote:

Nektra OEAPI Support

unread,
Apr 9, 2008, 2:07:52 PM4/9/08
to Nektra...@googlegroups.com
Hi again David:

If you are already doing that then it should work correctly, there might
be another problem, so we would need you to send us a sample project
(directly to this oeapi-support email address) ready to compile to make
research on this issue.
If you send it, please ask us to confirm that we received it because we
had problems receiving attachments with some customers.

Thank you for contacting Nektra's OEAPI Support.

Regards,

Federico

David wrote:
> Dear Federico:
> Sorry to reply it late. Thanks for your information. Actually, i
> create the OEFolderManager/OEFolder/OEMessage in each thread in my
> code because the COM thread model is "Apartment". But it still can not
> work.
>
> BRs
> JunLu

--

jose leonides tenahua machorro

unread,
Apr 9, 2008, 3:16:16 PM4/9/08
to Nektra...@googlegroups.com
ya no me molestes

Nektra OEAPI Support <oeapi-...@nektra.com> escribió:


¡Capacidad ilimitada de almacenamiento en tu correo!
No te preocupes más por el espacio de tu cuenta con Correo Yahoo!:
http://correo.yahoo.com.mx/
Reply all
Reply to author
Forward
0 new messages