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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Amrit Jassal
Sent: Friday, 10 March 2006 7:21 AM
To: [email protected]
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
_______________________________________________
Python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to