[python-win32] Casting to a specific interface
Mark Hammond
mhammond at skippinet.com.au
Fri Mar 10 00:03:25 CET 2006
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/20060310/d891e32d/attachment-0001.htm
More information about the Python-win32
mailing list