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

Outlook Object Model Threading



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 24th 07, 04:32 PM posted to microsoft.public.outlook,microsoft.public.outlook.program_addins
MON205
external usenet poster
 
Posts: 31
Default Outlook Object Model Threading

Hello all,
after months of working in an addin for outlook using OOM, I found a big
problem which is that OOM is not multithreaded as discussed in:
http://groups.google.jo/group/micros...3609c5934618a8
http://groups.google.jo/group/micros...d9ee67eed9d3c7

Problems started with multithreaded as I described in an earlier question
http://www.microsoft.com/communities...g=en&cr=us&p=1

and then I found that the problem is threading problem.
Now I used marshaling in my threads, threading now is acceptable, but a one
problem found, which is when I call the SaveAs() method of the MailItem, the
mouse cursor changed to busy. I don't want this scenario... can I prevent
it?!!
It is possible to move to other technologies like MAPI, but how can I save
mails?!!

Please help...
Ads
  #2  
Old April 24th 07, 08:55 PM posted to microsoft.public.outlook,microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Outlook Object Model Threading

Yes, you can use MAPI to do that:
http://support.microsoft.com/kb/171907

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

"MON205" wrote in message
...
Hello all,
after months of working in an addin for outlook using OOM, I found a big
problem which is that OOM is not multithreaded as discussed in:
http://groups.google.jo/group/micros...3609c5934618a8
http://groups.google.jo/group/micros...d9ee67eed9d3c7

Problems started with multithreaded as I described in an earlier question
http://www.microsoft.com/communities...g=en&cr=us&p=1

and then I found that the problem is threading problem.
Now I used marshaling in my threads, threading now is acceptable, but a
one
problem found, which is when I call the SaveAs() method of the MailItem,
the
mouse cursor changed to busy. I don't want this scenario... can I prevent
it?!!
It is possible to move to other technologies like MAPI, but how can I save
mails?!!

Please help...



  #3  
Old April 25th 07, 08:36 AM posted to microsoft.public.outlook,microsoft.public.outlook.program_addins
MON205
external usenet poster
 
Posts: 31
Default Outlook Object Model Threading

Oh...
Thanks a lot for fast response...
Now, if I pass a message interface to a thread to save it, is this a thread
safe?!!
Thanks again.

"Dmitry Streblechenko" wrote:

Yes, you can use MAPI to do that:
http://support.microsoft.com/kb/171907

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

"MON205" wrote in message
...
Hello all,
after months of working in an addin for outlook using OOM, I found a big
problem which is that OOM is not multithreaded as discussed in:
http://groups.google.jo/group/micros...3609c5934618a8
http://groups.google.jo/group/micros...d9ee67eed9d3c7

Problems started with multithreaded as I described in an earlier question
http://www.microsoft.com/communities...g=en&cr=us&p=1

and then I found that the problem is threading problem.
Now I used marshaling in my threads, threading now is acceptable, but a
one
problem found, which is when I call the SaveAs() method of the MailItem,
the
mouse cursor changed to busy. I don't want this scenario... can I prevent
it?!!
It is possible to move to other technologies like MAPI, but how can I save
mails?!!

Please help...




  #4  
Old April 25th 07, 06:59 PM posted to microsoft.public.outlook,microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Outlook Object Model Threading

I'd rather open the message on the secondary thread.
I also have a feeling that spawning a secondary thread just to save a single
message will actually make the performance worse.

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

"MON205" wrote in message
news
Oh...
Thanks a lot for fast response...
Now, if I pass a message interface to a thread to save it, is this a
thread
safe?!!
Thanks again.

"Dmitry Streblechenko" wrote:

Yes, you can use MAPI to do that:
http://support.microsoft.com/kb/171907

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

"MON205" wrote in message
...
Hello all,
after months of working in an addin for outlook using OOM, I found a
big
problem which is that OOM is not multithreaded as discussed in:
http://groups.google.jo/group/micros...3609c5934618a8
http://groups.google.jo/group/micros...d9ee67eed9d3c7

Problems started with multithreaded as I described in an earlier
question
http://www.microsoft.com/communities...g=en&cr=us&p=1

and then I found that the problem is threading problem.
Now I used marshaling in my threads, threading now is acceptable, but a
one
problem found, which is when I call the SaveAs() method of the
MailItem,
the
mouse cursor changed to busy. I don't want this scenario... can I
prevent
it?!!
It is possible to move to other technologies like MAPI, but how can I
save
mails?!!

Please help...






  #5  
Old April 26th 07, 08:40 AM posted to microsoft.public.outlook,microsoft.public.outlook.program_addins
MON205
external usenet poster
 
Posts: 31
Default Outlook Object Model Threading

I'll take this in consideration.
Thanks a lot.

"Dmitry Streblechenko" wrote:

I'd rather open the message on the secondary thread.
I also have a feeling that spawning a secondary thread just to save a single
message will actually make the performance worse.

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

"MON205" wrote in message
news
Oh...
Thanks a lot for fast response...
Now, if I pass a message interface to a thread to save it, is this a
thread
safe?!!
Thanks again.

"Dmitry Streblechenko" wrote:

Yes, you can use MAPI to do that:
http://support.microsoft.com/kb/171907

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

"MON205" wrote in message
...
Hello all,
after months of working in an addin for outlook using OOM, I found a
big
problem which is that OOM is not multithreaded as discussed in:
http://groups.google.jo/group/micros...3609c5934618a8
http://groups.google.jo/group/micros...d9ee67eed9d3c7

Problems started with multithreaded as I described in an earlier
question
http://www.microsoft.com/communities...g=en&cr=us&p=1

and then I found that the problem is threading problem.
Now I used marshaling in my threads, threading now is acceptable, but a
one
problem found, which is when I call the SaveAs() method of the
MailItem,
the
mouse cursor changed to busy. I don't want this scenario... can I
prevent
it?!!
It is possible to move to other technologies like MAPI, but how can I
save
mails?!!

Please help...






  #6  
Old May 3rd 07, 02:46 PM posted to microsoft.public.outlook,microsoft.public.outlook.program_addins
MON205
external usenet poster
 
Posts: 31
Default Outlook Object Model Threading

Hello,
I found that the scenario in the Microsoft link:
http://support.microsoft.com/kb/171907
leads into memory leak!!!!!!
What is the problem?!!!

"MON205" wrote:

I'll take this in consideration.
Thanks a lot.

"Dmitry Streblechenko" wrote:

I'd rather open the message on the secondary thread.
I also have a feeling that spawning a secondary thread just to save a single
message will actually make the performance worse.

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

"MON205" wrote in message
news
Oh...
Thanks a lot for fast response...
Now, if I pass a message interface to a thread to save it, is this a
thread
safe?!!
Thanks again.

"Dmitry Streblechenko" wrote:

Yes, you can use MAPI to do that:
http://support.microsoft.com/kb/171907

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

"MON205" wrote in message
...
Hello all,
after months of working in an addin for outlook using OOM, I found a
big
problem which is that OOM is not multithreaded as discussed in:
http://groups.google.jo/group/micros...3609c5934618a8
http://groups.google.jo/group/micros...d9ee67eed9d3c7

Problems started with multithreaded as I described in an earlier
question
http://www.microsoft.com/communities...g=en&cr=us&p=1

and then I found that the problem is threading problem.
Now I used marshaling in my threads, threading now is acceptable, but a
one
problem found, which is when I call the SaveAs() method of the
MailItem,
the
mouse cursor changed to busy. I don't want this scenario... can I
prevent
it?!!
It is possible to move to other technologies like MAPI, but how can I
save
mails?!!

Please help...






  #7  
Old May 3rd 07, 07:03 PM posted to microsoft.public.outlook,microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Outlook Object Model Threading

And how does the memory leak manifest itself?

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

"MON205" wrote in message
news
Hello,
I found that the scenario in the Microsoft link:
http://support.microsoft.com/kb/171907
leads into memory leak!!!!!!
What is the problem?!!!

"MON205" wrote:

I'll take this in consideration.
Thanks a lot.

"Dmitry Streblechenko" wrote:

I'd rather open the message on the secondary thread.
I also have a feeling that spawning a secondary thread just to save a
single
message will actually make the performance worse.

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

"MON205" wrote in message
news Oh...
Thanks a lot for fast response...
Now, if I pass a message interface to a thread to save it, is this a
thread
safe?!!
Thanks again.

"Dmitry Streblechenko" wrote:

Yes, you can use MAPI to do that:
http://support.microsoft.com/kb/171907

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

"MON205" wrote in message
...
Hello all,
after months of working in an addin for outlook using OOM, I found
a
big
problem which is that OOM is not multithreaded as discussed in:
http://groups.google.jo/group/micros...3609c5934618a8
http://groups.google.jo/group/micros...d9ee67eed9d3c7

Problems started with multithreaded as I described in an earlier
question
http://www.microsoft.com/communities...g=en&cr=us&p=1

and then I found that the problem is threading problem.
Now I used marshaling in my threads, threading now is acceptable,
but a
one
problem found, which is when I call the SaveAs() method of the
MailItem,
the
mouse cursor changed to busy. I don't want this scenario... can I
prevent
it?!!
It is possible to move to other technologies like MAPI, but how
can I
save
mails?!!

Please help...








  #8  
Old May 6th 07, 09:44 AM posted to microsoft.public.outlook,microsoft.public.outlook.program_addins
MON205
external usenet poster
 
Posts: 31
Default Outlook Object Model Threading

From the Windows Task Manager \ Processes \ Outlook:
When I enter the SaveToMsg() function – Mem Usage = 31,592 KB, and number of
handles 587.
When returning from the function, Mem Usage = 31,672 KB, Handles = 594.
Note that this increase in memory is not fixed and I think that it depends
on the Mail Size. Imaging what will happen when saving 10,000 mail or more!!!
In the following table (it will not shown as a table here!!!), I wrote the
values of memory and handles after each call in the SaveToMag().

Time Mem Usage (KB) No. of Handles
----------------------------------------------------------------------

When enter the SaveToMsg 31,592 587
After StgCreateDocfile 31,616 594
After OpenIMsgSession No Change No Change
After OpenIMsgOnIStg 31,624 No Change
After WriteClassStg No Change No Change
After CopyTo 31,848 595
After SaveChanges 31,960 594
After Commit 31,968 No Change
After pStorage-Release No Change No Change
After pIMsg-Release 31,672 No Change
After CloseIMsgSession No Change No Change
After{
pStorage = NULL;
pIMsg = NULL;
pMsgSession = NULL;} No Change No Change
-------------------------------------------------------------------------
I hope someone can help on this.



-------------------------------------
"Dmitry Streblechenko" wrote:

And how does the memory leak manifest itself?

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

"MON205" wrote in message
news
Hello,
I found that the scenario in the Microsoft link:
http://support.microsoft.com/kb/171907
leads into memory leak!!!!!!
What is the problem?!!!

"MON205" wrote:

I'll take this in consideration.
Thanks a lot.

"Dmitry Streblechenko" wrote:

I'd rather open the message on the secondary thread.
I also have a feeling that spawning a secondary thread just to save a
single
message will actually make the performance worse.

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

"MON205" wrote in message
news Oh...
Thanks a lot for fast response...
Now, if I pass a message interface to a thread to save it, is this a
thread
safe?!!
Thanks again.

"Dmitry Streblechenko" wrote:

Yes, you can use MAPI to do that:
http://support.microsoft.com/kb/171907

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

"MON205" wrote in message
...
Hello all,
after months of working in an addin for outlook using OOM, I found
a
big
problem which is that OOM is not multithreaded as discussed in:
http://groups.google.jo/group/micros...3609c5934618a8
http://groups.google.jo/group/micros...d9ee67eed9d3c7

Problems started with multithreaded as I described in an earlier
question
http://www.microsoft.com/communities...g=en&cr=us&p=1

and then I found that the problem is threading problem.
Now I used marshaling in my threads, threading now is acceptable,
but a
one
problem found, which is when I call the SaveAs() method of the
MailItem,
the
mouse cursor changed to busy. I don't want this scenario... can I
prevent
it?!!
It is possible to move to other technologies like MAPI, but how
can I
save
mails?!!

Please help...









  #9  
Old May 6th 07, 05:37 PM posted to microsoft.public.outlook,microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Outlook Object Model Threading

MAPI has its own memory subsystem; so saving a single message won't tell you
much.
Try to save multiple (hundreds?) messages and see if you can spot any
problem.

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

"MON205" wrote in message
...
From the Windows Task Manager \ Processes \ Outlook:
When I enter the SaveToMsg() function - Mem Usage = 31,592 KB, and number
of
handles 587.
When returning from the function, Mem Usage = 31,672 KB, Handles = 594.
Note that this increase in memory is not fixed and I think that it depends
on the Mail Size. Imaging what will happen when saving 10,000 mail or
more!!!
In the following table (it will not shown as a table here!!!), I wrote the
values of memory and handles after each call in the SaveToMag().

Time Mem Usage (KB) No. of
Handles
----------------------------------------------------------------------

When enter the SaveToMsg 31,592 587
After StgCreateDocfile 31,616 594
After OpenIMsgSession No Change No Change
After OpenIMsgOnIStg 31,624 No Change
After WriteClassStg No Change No Change
After CopyTo 31,848 595
After SaveChanges 31,960 594
After Commit 31,968 No
Change
After pStorage-Release No Change No Change
After pIMsg-Release 31,672 No Change
After CloseIMsgSession No Change No Change
After{
pStorage = NULL;
pIMsg = NULL;
pMsgSession = NULL;} No Change No Change
-------------------------------------------------------------------------
I hope someone can help on this.



-------------------------------------
"Dmitry Streblechenko" wrote:

And how does the memory leak manifest itself?

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

"MON205" wrote in message
news
Hello,
I found that the scenario in the Microsoft link:
http://support.microsoft.com/kb/171907
leads into memory leak!!!!!!
What is the problem?!!!

"MON205" wrote:

I'll take this in consideration.
Thanks a lot.

"Dmitry Streblechenko" wrote:

I'd rather open the message on the secondary thread.
I also have a feeling that spawning a secondary thread just to save
a
single
message will actually make the performance worse.

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

"MON205" wrote in message
news Oh...
Thanks a lot for fast response...
Now, if I pass a message interface to a thread to save it, is this
a
thread
safe?!!
Thanks again.

"Dmitry Streblechenko" wrote:

Yes, you can use MAPI to do that:
http://support.microsoft.com/kb/171907

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

"MON205" wrote in message
...
Hello all,
after months of working in an addin for outlook using OOM, I
found
a
big
problem which is that OOM is not multithreaded as discussed in:
http://groups.google.jo/group/micros...3609c5934618a8
http://groups.google.jo/group/micros...d9ee67eed9d3c7

Problems started with multithreaded as I described in an
earlier
question
http://www.microsoft.com/communities...g=en&cr=us&p=1

and then I found that the problem is threading problem.
Now I used marshaling in my threads, threading now is
acceptable,
but a
one
problem found, which is when I call the SaveAs() method of the
MailItem,
the
mouse cursor changed to busy. I don't want this scenario... can
I
prevent
it?!!
It is possible to move to other technologies like MAPI, but how
can I
save
mails?!!

Please help...











 




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
Outlook Object Model Threading MON205 Outlook - General Queries 8 May 6th 07 05:37 PM
Outlook object model guard Mark Priem Outlook and VBA 7 January 3rd 07 07:41 PM
Outlook object model guard crisis mpriem Outlook - General Queries 17 January 3rd 07 05:20 PM
Outlook Object Model - Mail Merge Vera Lemon Outlook and VBA 1 November 1st 06 07:10 AM
How to redistribute Outlook Object Model? papachina Outlook and VBA 5 September 11th 06 08:14 PM


All times are GMT +1. The time now is 08:37 PM.


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.