ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-win32
python-win32
[python-win32] win32com: Connecting event class after object creation
by Celvin other posts by this author
Nov 3 2009 2:03AM messages near this date
Re: [python-win32] ISAPI filter | Re: [python-win32] win32com: Connecting event class after object creation
Hi,

I'm currently using win32com to access COM objects created via .NET's
COM interop, which is working surprisingly well.

Currently, I stumpled upon a minor problem, though: I would like to
connect a class implementing several event handlers to an COM object
returned by a method call of another COM object.

What I'm doing is basically this:

class event_class:
    def event_handler1(self):
        pass

class another_event_class:
    def foobar(self):
        pass

obj = win32com.client.DispatchWithEvents("{...}", event_class)
new_obj = obj.CreateObject()
# here i would like another_event_class to handle events of new_obj

Do I have to use new_obj._oleobj_'s QueryInterface to obtain an
interface pointer to IID_IConnectionPointContainer and attach the
event handler myself, or is there any other, more comfortable way
using win32com?


Any pointers are appreciated,
Celvin


_______________________________________________
python-win32 mailing list
python-win32@[...].org
http://mail.python.org/mailman/listinfo/python-win32
Thread:
Celvin
Mark Hammond

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved