Morris, Steve (SW/FW - Rehovot)
2008-01-07 17:54:31 UTC
How do you implement callbacks?
The IDL has the following code:
module iPC_API {
interface iPC_API_WatchDogObserver { boolean connectionAlive();};
interface iPC_Connect : PropertyManager {
exception UnableToConnect {wstring why;};
iPC_Device connectToiPCDevice(in iPC_API_WatchDogObserver watchDogObserver) raises (UnableToConnect);
}
}
I derive a class from iPC_API_WatchDogObserver and define its method
class iPCWatchdogObserver(iPC_API__POA.iPC_API_WatchDogObserver):
def connectionAlive(self):
return True
I create an instance of iPCWatchdogObserver
self.watchdogObserver = iPCWatchdogObserver()
I call connectToiPCDevice() with the
iPCDevice = self.iPCConnect.connectToiPCDevice(self.watchdogObserver)
I get the following exception
'Traceback (most recent call last):
File "C:\\projects\\JobPreview\\JobPreviewFrame.py", line 477, in LoadJobListFromiPC
iPCDevice = self.iPCConnect.connectToiPCDevice(self.watchdogObserver)
File "C:\\projects\\JobPreview\\iPC_Connect_idl.py", line 3124, in connectToiPCDevice
return _omnipy.invoke(self, "connectToiPCDevice", _0_iPC_API.iPC_Connect._d_connectToiPCDevice, args)
BAD_PARAM: CORBA.BAD_PARAM(omniORB.BAD_PARAM_WrongPythonType, CORBA.COMPLETED_NO)\n'
What am I doing wrong?
Thanks,
Steve
The IDL has the following code:
module iPC_API {
interface iPC_API_WatchDogObserver { boolean connectionAlive();};
interface iPC_Connect : PropertyManager {
exception UnableToConnect {wstring why;};
iPC_Device connectToiPCDevice(in iPC_API_WatchDogObserver watchDogObserver) raises (UnableToConnect);
}
}
I derive a class from iPC_API_WatchDogObserver and define its method
class iPCWatchdogObserver(iPC_API__POA.iPC_API_WatchDogObserver):
def connectionAlive(self):
return True
I create an instance of iPCWatchdogObserver
self.watchdogObserver = iPCWatchdogObserver()
I call connectToiPCDevice() with the
iPCDevice = self.iPCConnect.connectToiPCDevice(self.watchdogObserver)
I get the following exception
'Traceback (most recent call last):
File "C:\\projects\\JobPreview\\JobPreviewFrame.py", line 477, in LoadJobListFromiPC
iPCDevice = self.iPCConnect.connectToiPCDevice(self.watchdogObserver)
File "C:\\projects\\JobPreview\\iPC_Connect_idl.py", line 3124, in connectToiPCDevice
return _omnipy.invoke(self, "connectToiPCDevice", _0_iPC_API.iPC_Connect._d_connectToiPCDevice, args)
BAD_PARAM: CORBA.BAD_PARAM(omniORB.BAD_PARAM_WrongPythonType, CORBA.COMPLETED_NO)\n'
What am I doing wrong?
Thanks,
Steve