Catch the COMError exception and inspect its attributes.
-------------------------> "These thoughts are mine alone!" <---------
Andrew MacIntyre Operations Branch
tel: +61 2 6219 5356 Communications Infrastructure Division
fax: +61 2 6253 3277 Australian Communications & Media Authority
email: andrew.macint...@acma.gov.au http://www.acma.gov.au/
From: Allen Saunders [mailto:allenmsaund...@gmail.com]
Sent: Thursday, 14 January 2010 7:23 AM
To: comtypes-users@lists.sourceforge.net
Subject: [comtypes-users] getting successful HRESULT values from
comtypes
Calling COM methods is straightforward just like with other
Python objects. They can be called with positional and named arguments.
Arguments marked [out] or [out, retval] in the IDL are returned
from a sucessful method call, in a tuple if there is more than one. If
no [out] or [out, retval] arguments are present, the HRESULT returned by
the method call is returned. When [out] or [out, retval] arguments are
returned from a sucessful call, the HRESULT value is lost.
If the COM method call fails, a COMError exception is raised,
containing the HRESULT value.
Is it true that there is no way to get a successful HRESULT from a call
that has [out] variables? An example is a function that can timeout, it
may return either S_OK (0) or S_FALSE (1), an the difference between the
two is important!
Is there anyway for me to retrieve that 'lost' HRESULT?
If you have received this email in error, please notify the sender immediately
and erase all copies of the email and any attachments to it. The information
contained in this email and any attachments may be private, confidential and
legally privileged or the subject of copyright. If you are not the addressee it
may be illegal to review, disclose, use, forward, or distribute this email
and/or its contents.
Unless otherwise specified, the information in the email and any attachments is
intended as a guide only and should not be relied upon as legal or technical
advice or regarded as a substitute for legal or technical advice in individual
cases. Opinions contained in this email or any of its attachments do not
necessarily reflect the opinions of ACMA.
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users