I'm having a bit of a play with using COM objects with Python and have run into a small problem.
The COM object I am using has a method called SetCallback which takes a object, the mothod looks like this:
[id(0x60010010)]
void SetCallback([in] IDispatch* callbackobject);
Taken from MS OLE/COM Object viewer
Now if I create and instance of my COM app in python everything is fine until I try and pass an instance of a object to this method.
callback = Callback()
mycomobject.SetCallback(callback)
class Callback():
def SetStatusText(self,status):
print status
The error I get in the python window is: TypeError: The Python instance can not be converted to a COM object
When doing the same thing in C# I used to make my class def look like this:
[ComVisible(True)]
public class Callback
{
//some methods here
}
and the method call is the same as Python version.
Is there something like this I have to do in Python in order to use an instance of a object as a callback for a COM object.