Hi All,

I am calling a Com method from python. I want to get the return value of COM
method

COM method has following parameters [in, out], [out], and [out, retval]
(This is from form.tlh)
public bool SomeFunc(ref string name, int age)
{
  /*.....
   do some work
  .....*/
  return true
}

In Python, I am doing somethiong like this:

from comtypes.client import CreateObject

comObj = CreateObject("....")
name = "abc"
print comObj.SomeFunc("abc", 5,)

It just prints value of msg i.e. "abc"

If I am trying something like this:
name = "abc"
ret = False
comIObj.SomeFunc("abc", 5, ret)

It is throwing following error:

Traceback (most recent call last):
  File "C:\Documents and Settings\paswal\Desktop\com_test.py", line 19, in
<module>
    print SomeFunc(name, age, ret)
  File "C:\Python26\lib\site-packages\comtypes\__init__.py", line 604, in
call_with_inout
    rescode = func(self_, *args, **kw)
TypeError: call takes exactly 3 arguments (4 given)


Can anybody point me out what's going wrong here
Is there a way to get boolean ret value (i.e. [out, retval]) from the
method???

-- 
Keep Rocking...
------------------------------------------------------------------------------

_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to