DispatchWithEvents when have internal COM interfaces

gloom o_gloom at mail.com
Tue Mar 9 11:54:13 CET 2004


Hey,

I'm trying to interface NeroSDK COM for burning CDRs.
Everything works fine, but I have problems figuring out how to handle
events which are not in the main COM object.

What I mean is that in the makepy generated source I see:
'class _INeroEvents' which correspond to
DispatchWithEvents("Nero.Nero", MyEventClass)

But I also have
class _INeroDriveEvents
which is part of:
class NeroDrive(CoClassBaseClass): # A CoClass
	# NeroDrive Class
	CLSID = IID('{F3FBC8E7-93A3-11D4-8217-A85459000000}')
	coclass_sources = [
		_INeroDriveEvents,
	]
	default_source = _INeroDriveEvents
	coclass_interfaces = [
		INeroDrive2,
		INeroDrive,
	]
	default_interface = INeroDrive2


Now, usually I would do something like this:
nero = DispatchWithEvents("Nero.Nero", MyEventClass)
drives = nero.GetDrives(NERO_MEDIA_CD)
drive[0].DoSomethingThatGenerateAnEvent()

But I don't know how to pass an event handle to handle drive events.

This is what I get with GetDrives:
>>> a.GetDrives(constants.NERO_MEDIA_CD)
<win32com.gen_py.Nero 1.1 Type Library.INeroDrives instance at
0x19219160>


Further, in VB, the event functions of the drive are named:
drive_OnXXXX()

while event functions for nero main objects are named:
nero_OnXXXX()


I would gladly appreciate any suggestions.
Thanks a lot,
Omer.



More information about the Python-list mailing list