[python-win32] Casting to a specific interface

Amrit Jassal ajassal at gmail.com
Fri Mar 10 07:44:45 CET 2006


Mark

That would be great.

Thanks a lot.


On 3/9/06, Mark Hammond <mhammond at skippinet.com.au> wrote:
>
> I'm afraid IMAPIStatus isn't exposed via pywin32 - depending on your
> patience, I could probably get it done within a week or so, maybe even in
> time for build 208 :)
>
> Mark
>
> -----Original Message-----
> *From:* python-win32-bounces at python.org [mailto:
> python-win32-bounces at python.org]*On Behalf Of *Amrit Jassal
> *Sent:* Friday, 10 March 2006 7:21 AM
> *To:* Python-win32 at python.org
> *Subject:* [python-win32] Casting to a specific interface
>
> I have a fairly basic question.
> I am trying to map a PyIUnknown interface to a specific (in this case
> IMAPIStatus) interface. How do I do that?
>
> Here is what I have:
>
>         import mapi, ...
>
>         tab = self.session.GetStatusTable(0)
>         rows = mapi.HrQueryAllRows(tab,
>                                    (PR_ENTRYID, PR_RESOURCE_TYPE),   #
> columns to retrieve
>                                    None,     # all rows
>                                    None,            # any sort order is
> fine
>                                    0)               # any # of results is
> fine
>         for row in rows:
>             (eid_tag, eid), (res_tag, res_name) = row
>         if res_tag == PR_RESOURCE_TYPE and res_name == 37:    #
> MAPI_SPOOLER
>                 stat = self.session.OpenEntry(eid, None,
> mapi.MAPI_DEFERRED_ERRORS)
>         stat.FlushQueues(None, None, 0x10)    # FLUSH_NO_UI
>
> FlushQueues() obviously requires a IMAPIStatus interface. The
> documentation for OpenEntry() states that passing NULL should give me the
> correct interface type.
>
> Thanks
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20060309/300ff23b/attachment.html 


More information about the Python-win32 mailing list