> I try to talk with Python to a LabVIEW-Application called 
> "cbt" via ActiveX.
> 
> Now I´m running into problem calling the "Call" method.
> 
> Here´s the code:
> ------------
> import win32com.client
> oLv = win32com.client.Dispatch("cbt.Application")

Try either

oLv = win32com.client.gencache.EnsureDispatch("cbt.Application")

or:

> strVi = oLv.ApplicationDirectory + "\\cbt.exe\\" + "cdcAxLogPrint.vi"
> 
> # retrieving the reference to the VI to be called via "Call"
> oViLogPrint = oLv.GetVIReference(strVi,"",True)   
> 
> arIn  = ["strEntry","Error"]
> arOut = ["Hello World",True]
> 

obViLogPrint._FlagAsMethod("Call")

> oViLogPrint.Call(arIn,arOut)

> ------------
> The resulting error message:
>     oViLogPrint.Call(arIn,arOut)
> TypeError: 'NoneType' object is not callable

The problem is that .Call is being interpreted as a property reference
rather than a method call.  The former should trigger early-binding, which
should  avoid the problem.  If that doesn't work, the latter is still using
late-binding, but offering a hint to win32com that Call is a method rather
than a property.

Mark

<<attachment: winmail.dat>>

_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to