win32com: how to call func with optional params

Tom Hines tom_hines at my-deja.com
Thu Mar 30 19:37:22 CEST 2000


I tried passing None, but it was apparently interpretted as the BSTR
value "None".

In article <8bvvsj$568$1 at nnrp1.deja.com>,
Tom Hines <tom_hines at my-deja.com> wrote:
> How do you call a function with optional parameters in win32com? In
> Visual Basic you can write:
>
> obj.MyFunc(parm1, , , parm4)
>
> but this is invalid syntax in Python.
>
> In C++, you need to construct a special Variant argument like so:
>
> _variant_t vopt;
> vopt.vt = VT_ERROR;
> vopt.scode = DISP_E_PARAMNOTFOUND;
> obj.MyFunc(parm1, vopt, vopt, parm4);
>
> How do you do it in Python?
>
> Thanks for your help.
>
> --
> Tom Hines
> Rockville, MD
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list