Åsmund Hjulstad wrote:
> I keep getting the following exception when making some calls on a
> ActiveX DLL library (PISDK). Problem partially solved, posting in case
> others may find it usefull.
>
> TypeError: The Python instance can not be converted to a COM object
>
> I have traced it down to an optional parameter, that is set to 0, but
> should (probably) be set to None.
>
> the makepy signature is:
>
> GetPoints(self, WhereClause=<PyOleEmpty object>, pAsynchStatus=0)
>
> Doing the call using
>
> server.GetPoints(" tag = 'FT12345/*' ", None)
>
> works fine. ...
>
> As the optional parameter is easy to forget, especially when querying
> interactively in ipython, is it possible to make makepy understand
> that the optional parameter should be None, instead of 0?

Makepy makes an educated guess, based on the data type of the
parameter.  However, some people lie about their data types when they
make an interface like this.  Instead of declaring it a pointer, they'll
declare it as an integer.  Makepy isn't omniscient.

Do you have the IDL that describes the function, or a web page
reference?  Can you show us the script that makepy generated?

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

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

Reply via email to