Hi All, I have a COM application that has a method ProcessMessage which takes a pointer to BSTR. The definition in IDL is as follows. methods: [id(1), helpstring("method ProcessMessage")] BSTR ProcessMessage(BSTR* Message);
I tried calling the method from python as follows: msg = comtypes.BSTR("111 Command") app = comtypes.client.CreateObject("Test1.Application") app.ProcessMessage(byref(msg)) But i get the following error: Traceback (most recent call last): File "C:\test.py", line 8, in <module> app.ProcessMessage(byref(msg)) File "C:\Python25\Lib\site-packages\comtypes\client\dynamic.py", line 42, in __call__ return self._obj._comobj.Invoke(self._id, *args) File "C:\Python25\Lib\site-packages\comtypes\automation.py", line 701, in Invoke array[i].value = a File "C:\Python25\Lib\site-packages\comtypes\automation.py", line 300, in _set_value raise TypeError("Cannot put %r in VARIANT" % value) TypeError: Cannot put <cparam 'P' (00b9ea58)> in VARIANT What could be the problem? TIA, Bejoy ------------------------------------------------------------------------------ _______________________________________________ comtypes-users mailing list comtypes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/comtypes-users