[python-win32] Problems with QuickTest Automation Object Model

Tim Roberts timr at probo.com
Wed Sep 9 20:15:06 CEST 2009


Dennis Chung wrote:
>
> I assume these default values are coming from the COM library itself
> and makepy.py is simply pulling these defaults.

COM doesn't know anything about None.  That's strictly a Python invention.


> According to Python Object Browser, the first argument for Run is
> "Pointer User Defined" with default value of 0 (See below).  I have
> identified another method, UpdateRun, that exhibits the same
> problems.  A common element between the two methods is the
> ResultsOptions parameter.  UpdateRun also includes an UpdateOptions
> parameter which is similar.  Infact they should both be collections. 
> What's interesting is that these two classes appear to be named
> _RunResultsOptions and _UpdateRunOptions (see makepy gen output
> below).  Is this an issue with win32com or HP QTP or both?

Very interesting!  So, in the type library, it's NOT declared as an
IDispatch *, but rather as a void *.  If the parameter is allowed to
take arbitrary pointers, and not just COM objects, then I'm not sure
there is a good solution for this.  You can certainly modify the
makepy-generated wrapper file by hand and change the defaults from 0 to
None.

If it's supposed to be a COM object always, then HP should probably
update their type library.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list