-
Notifications
You must be signed in to change notification settings - Fork 844
Fix struct handling in makepy generated code #2560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
f59e1ba
35f46ff
ef45c98
5131e7c
e6bbc1c
b41420e
9c1388b
c9a1dce
e6f5857
29c6533
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -382,6 +382,22 @@ def MakeDispatchFuncMethod(self, entry, name, bMakeClass=1): | |
| if doc and doc[1]: | ||
| ret.append(linePrefix + "\t" + _makeDocString(doc[1])) | ||
|
|
||
| for i in range(len(fdesc[2])): | ||
| desc = fdesc[2][i] | ||
|
|
||
| if ( | ||
| desc[1] & (pythoncom.PARAMFLAG_FOUT | pythoncom.PARAMFLAG_FIN) | ||
| == pythoncom.PARAMFLAG_FOUT | ||
| ): | ||
| if ( | ||
| desc[0] & pythoncom.VT_RECORD | ||
| and desc[3] | ||
| and desc[3].__class__.__name__ == "PyIID" | ||
| ): | ||
| newVal = f"pythoncom.GetRecordFromGuids(CLSID, MajorVersion, MinorVersion, LCID, {repr(desc[3])})" | ||
|
||
| ret.append(linePrefix + "\t" + f"if {names[i+1]} == {defOutArg}:") | ||
| ret.append(linePrefix + "\t\t" + f"{names[i+1]} = {newVal}") | ||
the-snork marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| resclsid = entry.GetResultCLSID() | ||
| if resclsid: | ||
| resclsid = "'%s'" % resclsid | ||
|
|
@@ -592,7 +608,7 @@ def _ResolveType(typerepr, itypeinfo): | |
| return pythoncom.VT_UNKNOWN, clsid, retdoc | ||
|
|
||
| elif typeKind == pythoncom.TKIND_RECORD: | ||
| return pythoncom.VT_RECORD, None, None | ||
| return pythoncom.VT_RECORD, resultAttr.iid, None | ||
| raise NotSupportedException("Can not resolve alias or user-defined type") | ||
| return typeSubstMap.get(typerepr, typerepr), None, None | ||
|
|
||
|
|
@@ -612,6 +628,7 @@ def _BuildArgList(fdesc, names): | |
| name_num = 0 | ||
| while len(names) < numArgs: | ||
| names.append("arg%d" % (len(names),)) | ||
|
|
||
| # As per BuildCallList(), avoid huge lines. | ||
| # Hack a "\n" at the end of every 5th name | ||
| for i in range(0, len(names), 5): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.