Torbjorn Tyridal schrieb:
> Another issue,
> 
> Is it possible to control the hResult value returned from event sinks ?
> 
> My COM object typically sends and event, assumes everything is fine
> and handled on S_OK and does some default handler if S_FAIL is
> returned.
> 

Well, I think that relying on the HRESULT of a event interface method call
is not a good idea.  FAILED HRESULT values are converted and raised as
Python exceptions by comtypes.

However, I would suggest that you use 'out' parameters in the event interface
methods; this would allow the client code to pass some information to the server
from an event.  For example, Internet Explorer also uses this mechanism in the
'BeforeNavigate' event which allows the client to forbid navigation depending
on the URL.

I have committed some code to comtypes in SVN that collects the return values
from event interface calls and returns a list of them from the Fire_Event(...)
call.  Does this help you?



But maybe I completely misunderstand you and you want to return special HRESULT
values from the event method implementations in your client ???

-- 
Thanks,
Thomas


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to