[python-win32] Getting HRESULT back from a com automation

Mark Hammond mhammond at skippinet.com.au
Sat May 26 10:16:40 CEST 2007


> I'm trying to get back the result of ie.Navigate().
> According to the MSDN
> documentation it should return a HRESULT.  It appears to
> return None.  Is
> there a way to get the return code from the com interaction?

All error HRESULTs are returned via exceptions.  Unfortunately, there isn't
a reliable way to get a success HRESULT - when it is known to be
significant, functions often return them, and it sounds like we could also
do that in your case (assuming it *always* returns None now).  It should
also be possible to stick all HRESULTs in some thread-local-storage and
fetchable via "GetLastHRESULT()" or similar.  What codes are you expecting
to see?

Mark



More information about the Python-win32 mailing list