comtypes icon indicating copy to clipboard operation
comtypes copied to clipboard

Returned tuple from COM method doesn't include all outputs

Open cfarrow opened this issue 11 years ago • 1 comments

I am accessing SolidWorks via COM using comtypes. I create a new application object as follows: swApp=comtypes.client.CreateObject('sldworks.application') To open files with this application, you use the OpenDoc6 method, which is as follows: ModelDoc2 OpenDoc6(string FileName, int Type, int Options, String Configuration, [Out] int Errors, [Out] int Warnings) (taken from the api help files. When I call swApp.OpenDoc6, the ModelDoc2 object is not returned. Instead I only get a tuple containing the Errors and Warnings. I have possible solution, which might not necessarily be all that good: If I change comtypes/init.py line 599 to use rescode (the return from the function) as opposed to outargs, then I get a tuple containing all three outputs. Not sure this would work for all COM libraries. djm one five eight @ieee.org (where the numbers are really numbers) to ask questions of me.

cfarrow avatar Feb 20 '14 02:02 cfarrow

Migrated from https://sourceforge.net/p/comtypes/bugs/14/.

cfarrow avatar Feb 20 '14 02:02 cfarrow