Federico Fanton wrote:
> Hi everyone!
> I'm trying to automate an operation with Alibre Design
> (http://www.alibre.com) via COM.
>
> It is mostly working, except for a call to a method that accepts a
> single optional boolean parameter. When I try to call this method, I get
> an "Invalid number of parameters" exception.

Is the exception coming from the InvokeTypes call?

> Here's my code:
> ...
> The exception is triggered from the last call.. makepy generates it in
> this way:
>
> ----------------
>
> def Close(self, saveSession=False):
>     """Closes the session and saves the modified session and
> sub-sessions, if any, to their original folder locations, if the
> saveSession flag is set to true. Use SaveNew or SaveAs if this session
> is being saved for the first time"""
>     return self._oleobj_.InvokeTypes(7, LCID, 1, (24, 0), ((11,
> 49),),saveSession )

Curious.  1 means it is a method, (24,0) means that it returns nothing,
and ((11,49)) means that it takes an optional Boolean with a default
value.  That should work just as you wrote it.

-- 
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to