enthought / enthought/comtypes

Returned tuple from COM method doesn't include all outputs

Open
#13 1 comment 0 reactions 0 assignees View on GitHub
3rd-party issue bug
Dominant language
Python
Stars
345
Forks
105
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.