NeroCOM events and wxPython, need help

vbimport

#1

Hello,
I’m trying to use NeroCOM in a Python program and I’m dealing with events problems.

All was ok up to defining the nero object and obtain CDInfo but I’m not able to make nero firing OnDriveStatusChanged event.

My program says:

import win32com.client as COM

self.nero = COM.Dispatch(“Nero.Nero”)

drives = self.nero.GetDrives(COM.constants.NERO_MEDIA_CD)

self.burner.CDInfo(COM.constants.NERO_READ_CD_TEXT)
… # loop for wait for end of gathering CD infos event

where self.burner is choosen by the user among “drives”

if drive.DevType == COM.constants.NERO_SCSI_DEVTYPE_WORM


self.cdInfo = COM.DispatchWithEvents(self.burner, infoEvent)

class infoEvent:
def init(self):
…self.evDoneCDInfo = win32event.CreateEvent(None, 0, 0, None)
def OnDoneCDInfo (self, PyDispatchObj):
… # read CD info from PyDispatchObj
…win32event.SetEvent(self.exDoneCDInfo)

This works fine. The OnDoneCDInfo event is fired up and trapped by my infoEvent class.
Now I’m trying to make NeroDrive trigger the OnDriveStatusChanged event but it doesn’t seem to work in any way.

Please help me, if someone is more familiar with event treatment in python and knows more deeply how to manage NeroCOM objects.

Thank you.


#2

Pardon, the correct sequence is:

import win32com.client as COM

self.nero = COM.Dispatch(“Nero.Nero”)

drives = self.nero.GetDrives(COM.constants.NERO_MEDIA_CD)

self.burner.CDInfo(COM.constants.NERO_READ_CD_TEXT)

where self.burner is choosen by the user among “drives”

if drive.DevType == COM.constants.NERO_SCSI_DEVTYPE_WORM


self.cdInfo = COM.DispatchWithEvents(self.burner, infoEvent)
… # loop for wait for end of gathering CD infos: evDoneCDInfo event

class infoEvent:
def init(self):
…self.evDoneCDInfo = win32event.CreateEvent(None, 0, 0, None)
def OnDoneCDInfo (self, PyDispatchObj):
… # read CD info from PyDispatchObj
…win32event.SetEvent(self.evDoneCDInfo)

Thank you.