| Store | Cart

DispatchWithEvents when have internal COM interfaces

From: gloom <o_gl...@mail.com>
9 Mar 2004 02:54:13 -0800
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.

Recent Messages in this Thread
gloom Mar 09, 2004 10:54 am
gloom Mar 10, 2004 08:47 am
Markus Wankus Mar 10, 2004 01:41 pm
Messages in this thread