> Thanks Rob and Jay for the replies. I'll check out http://g8.cx/mapi/.
>
> In the meantime, I made things work by creating one session per thread --
> not as elegant as I'd like, but it works.
Sven,
> I think the explanations for the errors you got might be a bit inaccurate:
I'm not certain I've seen a totally accurate explanation yet ;-)
> set the ApartmentState of that thread prior to starting it - I guess that
> "configures" the call to CoInitialize or CoInitializeEx. If you don't set
Agreed setting the ApartmentState of a Thread is how you set MTA or STA.
However my understanding is MAPI (CDO) requires a call to MapiInitialize in
addition to CoInitialize. However my limited experimentation & Rob's
comments suggests that MapiInitialize is called with STA only. Hence
MAPI.Session then throws an exception, as it is attempting to call
MapiInitilize with parameters with are incompatible with the previously set
ApartmentState...
> JUST A TECHNICAL DEMO, DONT DO THIS IN PRODUCTION CODE: just give it a try:
> set the ApartmentState property of your thread to MTA and you should be able
I suspect this will appear to work, I'm concerned what is really happening
(no call to CoInitialize or MapiInitialize)...
Hope this helps
Jay
> Hi Gary,
>
[quoted text clipped - 75 lines]
> > > >
> > > > Dave James
Sven Carstensen - 07 Jun 2004 20:13 GMT
Hi Jay,
> Sven,
> > I think the explanations for the errors you got might be a bit inaccurate:
> I'm not certain I've seen a totally accurate explanation yet ;-)
one could get the fealing that MS would like to forget about CDO 1.21 all
together ;-)
> > set the ApartmentState of that thread prior to starting it - I guess that
> > "configures" the call to CoInitialize or CoInitializeEx. If you don't set
[quoted text clipped - 6 lines]
> MapiInitilize with parameters with are incompatible with the previously set
> ApartmentState...
So true: I forgot MAPIInitialize - one would have to call it with the
MAPI_NO_COINIT flag to get it working in an MTA thread.
When oh when will we get a good replacment for CDO/ExMAPI with its client
side notifications and message file format.
Does WebDAV qualify as a candidate for saving messages to files? I like
ExMapi when it comes to its internal knowledge to ignore read only or
computed properties when I use OpenIMsgOnIStg to copy a message completely
to a file based storage.
<snip>
Bye,
SvenC