enthought / enthought/comtypes

array of BSTR is not supported

Open
#347 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
345
Forks
105
PR merge metrics
No merged PRs in 30d

Description

Hi, I really appreciate the great work to develop comtypes. Many thanks! I miss one feature which is the transfer of BSTR arrays. I suggest to change the following code lines in automation.py:

```
elif isinstance(value, (list, tuple)):
isstr = [isinstance(x,str) for x in value]
if not False in isstr:
bstrlist = []
for item in value:
bstrlist.append(cast(SysAllocStringLen(item, len(item)),BSTR))
obj = midlSAFEARRAY(BSTR).create(bstrlist)
else:
obj = _midlSAFEARRAY(VARIANT).create(value)
memmove(byref(self._), byref(obj), sizeof(obj))
self.vt = VT_ARRAY | obj._vartype_
```

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.