comtypes 1.4.7__zip → 1.4.8__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {comtypes-1.4.7 → comtypes-1.4.8}/CHANGES.txt +18 -0
- {comtypes-1.4.7/comtypes.egg-info → comtypes-1.4.8}/PKG-INFO +5 -3
- {comtypes-1.4.7 → comtypes-1.4.8}/README.md +4 -2
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/__init__.py +1 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_comobject.py +0 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_memberspec.py +1 -1
- comtypes-1.4.8/comtypes/_meta.py +95 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_npsupport.py +2 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_post_coinit/__init__.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_post_coinit/misc.py +20 -39
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_post_coinit/unknwn.py +94 -69
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/__init__.py +21 -31
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/_code_cache.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/_events.py +0 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/_generate.py +5 -5
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/lazybind.py +0 -5
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/git.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/hints.pyi +4 -4
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/persist.py +7 -7
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/safearray.py +2 -6
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/__init__.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/register.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/shelllink.py +48 -43
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestComServer.py +1 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestDispServer.py +1 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/__init__.py +0 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/find_memleak.py +0 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_agilent.py +0 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_clear_cache.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_createwrappers.py +0 -2
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_dispinterface.py +0 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_excel.py +0 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_inout_args.py +1 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_server.py +6 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_shelllink.py +10 -14
- comtypes-1.4.8/comtypes/test/test_stream.py +131 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_typeannotator.py +1 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_urlhistory.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_variant.py +0 -2
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/namespaces.py +97 -27
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/typeannotator.py +2 -4
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/tlbparser.py +33 -32
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/typedesc.py +2 -2
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/typeinfo.py +21 -25
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/util.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8/comtypes.egg-info}/PKG-INFO +5 -3
- comtypes-1.4.8/pyproject.toml +54 -0
- comtypes-1.4.7/comtypes/_meta.py +0 -70
- comtypes-1.4.7/comtypes/test/test_stream.py +0 -53
- comtypes-1.4.7/pyproject.toml +0 -3
- {comtypes-1.4.7 → comtypes-1.4.8}/LICENSE.txt +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/MANIFEST.in +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/GUID.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_idl_stuff.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_post_coinit/bstr.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_py_instance_method.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_safearray.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_tlib_version_checker.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/automation.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/clear_cache.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/_constants.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/dynamic.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/connectionpoints.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/errorinfo.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/hresult.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/logutil.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/messageloop.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/patcher.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/automation.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/connectionpoints.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/inprocserver.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/localserver.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/w_getopt.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/stream.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestComServer.idl +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestComServer.tlb +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestDispServer.idl +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestDispServer.tlb +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/mylib.idl +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/mylib.tlb +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/mytypelib.idl +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/runtests.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/setup.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_BSTR.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_DISPPARAMS.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_GUID.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_QueryService.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_avmc.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_basic.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_casesensitivity.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_client.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_client_dynamic.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_client_regenerate_modules.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_collections.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_comserver.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_dict.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_dispifc_records.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_dispifc_safearrays.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_dyndispatch.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_findgendir.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_getactiveobj.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_ie.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_ienum.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_imfattributes.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_jscript.js +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_midl_safearray_create.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_monikers.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_msscript.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_npsupport.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_outparam.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_persist.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_propputref.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_pump_events.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_recordinfo.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_safearray.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_sapi.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_showevents.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_storage.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_subinterface.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_typeinfo.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_win32com_interop.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_wmi.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_word.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/urlhist.tlb +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/__init__.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/__init__.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/codegenerator.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/helpers.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/modulenamer.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/packing.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/typedesc_base.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/viewobject.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes.egg-info/SOURCES.txt +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes.egg-info/dependency_links.txt +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes.egg-info/entry_points.txt +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes.egg-info/top_level.txt +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/setup.cfg +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/setup.py +0 -0
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
Comtypes CHANGELOG
|
|
2
2
|
==================
|
|
3
3
|
|
|
4
|
+
Release 1.4.8
|
|
5
|
+
--------------
|
|
6
|
+
* Remove Python 3.7 and add Python 3.13 to the CI pipelines. By @junkmd.
|
|
7
|
+
* Add constant definitions to ``shelllink``. By @junkmd.
|
|
8
|
+
* Add more tests to ``test_stream``. By @junkmd.
|
|
9
|
+
* Add the ``void_type`` definition to ``tlbparser``. By @junkmd.
|
|
10
|
+
* Modernize ``tools.tlbparser.get_tlib_filename``. By @junkmd.
|
|
11
|
+
* Extract the methods for parsing externals and dual interfaces from ``Parser.parse_typeinfo``. By @junkmd.
|
|
12
|
+
* Fix type annotations referenced by ``tlbparser``. By @junkmd.
|
|
13
|
+
* Modernize ``codegenerator.namespaces``. By @junkmd.
|
|
14
|
+
* Improve static typing for ``CoGetClassObject`` and ``GetClassObject``. By @junkmd.
|
|
15
|
+
* Refactor the ``__new__`` methods of ``_cominterface_meta`` and ``_coclass_meta``. By @junkmd.
|
|
16
|
+
* Prevent errors caused by defining members with the same name within an enum type. By @junkmd.
|
|
17
|
+
* Remove remaining ``__cmp__`` methods. By @newwingbird.
|
|
18
|
+
* Remove remaining ``from __future__ import print_function`` lines. By @newwingbird.
|
|
19
|
+
* Prevent ``itf`` to be an unbound variable in ``_cominterface_meta.__get_baseinterface_methodcount``. By @newwingbird.
|
|
20
|
+
* Modify the metaclasses to ensure compatibility with Python 3.13 and earlier versions. By @junkmd.
|
|
21
|
+
|
|
4
22
|
Release 1.4.7
|
|
5
23
|
--------------
|
|
6
24
|
* Improve ``_CArrayType`` alias import. By @junkmd.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: comtypes
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.8
|
|
4
4
|
Summary: Pure Python COM package
|
|
5
5
|
Home-page: https://github.com/enthought/comtypes
|
|
6
6
|
Download-URL: https://github.com/enthought/comtypes/releases
|
|
@@ -20,8 +20,9 @@ License-File: LICENSE.txt
|
|
|
20
20
|
# comtypes
|
|
21
21
|
|
|
22
22
|

|
|
23
|
-
[](https://pypi.org/project/comtypes/) [](https://pypi.org/project/comtypes/) [](https://pypi.org/project/comtypes/) [](https://pypi.org/project/comtypes/) [](https://pypi.org/project/comtypes/)
|
|
24
|
+
[](https://pypi.org/project/comtypes/) [](https://pypi.org/project/comtypes/)
|
|
25
|
+
[](https://github.com/enthought/comtypes/stargazers) [](https://github.com/enthought/comtypes/network/members) [](https://github.com/astral-sh/ruff)
|
|
25
26
|
[](https://tidelift.com/subscription/pkg/pypi-comtypes?utm_source=pypi-comtypes&utm_medium=readme)
|
|
26
27
|
|
|
27
28
|
|
|
@@ -30,6 +31,7 @@ License-File: LICENSE.txt
|
|
|
30
31
|
`comtypes` allows you to define, call, and implement custom and dispatch-based COM interfaces in pure Python.
|
|
31
32
|
|
|
32
33
|
`comtypes` requires Windows and Python 3.8 or later.
|
|
34
|
+
- Version <= [1.4.7](https://pypi.org/project/comtypes/1.4.7/) does not work with Python 3.13 as reported in [GH-618](https://github.com/enthought/comtypes/issues/618). Version [1.4.8](https://pypi.org/project/comtypes/1.4.8/) can work with Python 3.13.
|
|
33
35
|
- Version [1.4.6](https://pypi.org/project/comtypes/1.4.6/) is the last version to support Python 3.7.
|
|
34
36
|
- Version [1.2.1](https://pypi.org/project/comtypes/1.2.1/) is the last version to support Python 2.7 and 3.3–3.6.
|
|
35
37
|
- `comtypes` does not work with Python 3.8.1 as reported in [GH-202](https://github.com/enthought/comtypes/issues/202). This bug has been fixed in Python >= 3.8.2.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# comtypes
|
|
2
2
|
|
|
3
3
|

|
|
4
|
-
[](https://pypi.org/project/comtypes/) [](https://pypi.org/project/comtypes/) [](https://pypi.org/project/comtypes/) [](https://pypi.org/project/comtypes/) [](https://pypi.org/project/comtypes/)
|
|
5
|
+
[](https://pypi.org/project/comtypes/) [](https://pypi.org/project/comtypes/)
|
|
6
|
+
[](https://github.com/enthought/comtypes/stargazers) [](https://github.com/enthought/comtypes/network/members) [](https://github.com/astral-sh/ruff)
|
|
6
7
|
[](https://tidelift.com/subscription/pkg/pypi-comtypes?utm_source=pypi-comtypes&utm_medium=readme)
|
|
7
8
|
|
|
8
9
|
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
`comtypes` allows you to define, call, and implement custom and dispatch-based COM interfaces in pure Python.
|
|
12
13
|
|
|
13
14
|
`comtypes` requires Windows and Python 3.8 or later.
|
|
15
|
+
- Version <= [1.4.7](https://pypi.org/project/comtypes/1.4.7/) does not work with Python 3.13 as reported in [GH-618](https://github.com/enthought/comtypes/issues/618). Version [1.4.8](https://pypi.org/project/comtypes/1.4.8/) can work with Python 3.13.
|
|
14
16
|
- Version [1.4.6](https://pypi.org/project/comtypes/1.4.6/) is the last version to support Python 3.7.
|
|
15
17
|
- Version [1.2.1](https://pypi.org/project/comtypes/1.2.1/) is the last version to support Python 2.7 and 3.3–3.6.
|
|
16
18
|
- `comtypes` does not work with Python 3.8.1 as reported in [GH-202](https://github.com/enthought/comtypes/issues/202). This bug has been fixed in Python >= 3.8.2.
|
|
@@ -43,7 +43,7 @@ def _unpack_argspec(
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
def _resolve_argspec(
|
|
46
|
-
items: Tuple[_ArgSpecElmType, ...]
|
|
46
|
+
items: Tuple[_ArgSpecElmType, ...],
|
|
47
47
|
) -> Tuple[Tuple[_ParamFlagType, ...], Tuple[Type[_CData], ...]]:
|
|
48
48
|
"""Unpacks and converts from argspec to paramflags and argtypes.
|
|
49
49
|
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# comtypes._meta helper module
|
|
2
|
+
from ctypes import POINTER, c_void_p, cast
|
|
3
|
+
import comtypes
|
|
4
|
+
|
|
5
|
+
################################################################
|
|
6
|
+
# metaclass for CoClass (in comtypes/__init__.py)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _wrap_coclass(self):
|
|
10
|
+
# We are an IUnknown pointer, represented as a c_void_p instance,
|
|
11
|
+
# but we really want this interface:
|
|
12
|
+
itf = self._com_interfaces_[0]
|
|
13
|
+
punk = cast(self, POINTER(itf))
|
|
14
|
+
result = punk.QueryInterface(itf)
|
|
15
|
+
result.__dict__["__clsid"] = str(self._reg_clsid_)
|
|
16
|
+
return result
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _coclass_from_param(cls, obj):
|
|
20
|
+
if isinstance(obj, (cls._com_interfaces_[0], cls)):
|
|
21
|
+
return obj
|
|
22
|
+
raise TypeError(obj)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
#
|
|
26
|
+
# The mro() of a POINTER(App) type, where class App is a subclass of CoClass:
|
|
27
|
+
#
|
|
28
|
+
# POINTER(App)
|
|
29
|
+
# App
|
|
30
|
+
# CoClass
|
|
31
|
+
# c_void_p
|
|
32
|
+
# _SimpleCData
|
|
33
|
+
# _CData
|
|
34
|
+
# object
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class _coclass_meta(type):
|
|
38
|
+
# metaclass for CoClass
|
|
39
|
+
#
|
|
40
|
+
# When a CoClass subclass is created, create a POINTER(...) type
|
|
41
|
+
# for that class, with bases <coclass> and c_void_p. Also, the
|
|
42
|
+
# POINTER(...) type gets a __ctypes_from_outparam__ method which
|
|
43
|
+
# will QueryInterface for the default interface: the first one on
|
|
44
|
+
# the coclass' _com_interfaces_ list.
|
|
45
|
+
def __new__(cls, name, bases, namespace):
|
|
46
|
+
self = type.__new__(cls, name, bases, namespace)
|
|
47
|
+
if bases == (object,):
|
|
48
|
+
# HACK: Could this conditional branch be removed since it is never reached?
|
|
49
|
+
# Since definition is `class CoClass(COMObject, metaclass=_coclass_meta)`,
|
|
50
|
+
# the `bases` parameter passed to the `_coclass_meta.__new__` would be
|
|
51
|
+
# `(COMObject,)`.
|
|
52
|
+
# Moreover, since the `COMObject` derives from `object` and does not specify
|
|
53
|
+
# a metaclass, `(object,)` will not be passed as the `bases` parameter
|
|
54
|
+
# to the `_coclass_meta.__new__`.
|
|
55
|
+
# The reason for this implementation might be a remnant of the differences
|
|
56
|
+
# in how metaclasses work between Python 3.x and Python 2.x.
|
|
57
|
+
# If there are no problems with the versions of Python that `comtypes`
|
|
58
|
+
# supports, this removal could make the process flow easier to understand.
|
|
59
|
+
return self
|
|
60
|
+
# XXX We should insist that a _reg_clsid_ is present.
|
|
61
|
+
if "_reg_clsid_" in namespace:
|
|
62
|
+
clsid = namespace["_reg_clsid_"]
|
|
63
|
+
comtypes.com_coclass_registry[str(clsid)] = self
|
|
64
|
+
|
|
65
|
+
# `_coclass_pointer_meta` is a subclass inherited from `_coclass_meta`.
|
|
66
|
+
# In other words, when the `__new__` method of this metaclass is called, an
|
|
67
|
+
# instance of `_coclass_pointer_meta` might be created and assigned to `self`.
|
|
68
|
+
if isinstance(self, _coclass_pointer_meta):
|
|
69
|
+
# `self` is the `_coclass_pointer_meta` type or a `POINTER(coclass)` type.
|
|
70
|
+
# Prevent creating/registering a pointer to a pointer (to a pointer...),
|
|
71
|
+
# or specifying the metaclass type instance in the `bases` parameter when
|
|
72
|
+
# instantiating it, which would lead to infinite recursion.
|
|
73
|
+
# Depending on a version or revision of Python, this may be essential.
|
|
74
|
+
return self
|
|
75
|
+
|
|
76
|
+
PTR = _coclass_pointer_meta(
|
|
77
|
+
f"POINTER({self.__name__})",
|
|
78
|
+
(self, c_void_p),
|
|
79
|
+
{
|
|
80
|
+
"__ctypes_from_outparam__": _wrap_coclass,
|
|
81
|
+
"from_param": classmethod(_coclass_from_param),
|
|
82
|
+
},
|
|
83
|
+
)
|
|
84
|
+
from ctypes import _pointer_type_cache # type: ignore
|
|
85
|
+
|
|
86
|
+
_pointer_type_cache[self] = PTR
|
|
87
|
+
|
|
88
|
+
return self
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
# will not work if we change the order of the two base classes!
|
|
92
|
+
class _coclass_pointer_meta(type(c_void_p), _coclass_meta):
|
|
93
|
+
# metaclass for CoClass pointer
|
|
94
|
+
|
|
95
|
+
pass # no functionality, but needed to avoid a metaclass conflict
|
|
@@ -12,4 +12,5 @@ This subpackage is called simultaneously with the initialization of `comtypes`.
|
|
|
12
12
|
So it is necessary to maintain minimal settings to keep the lightweight action
|
|
13
13
|
when the package is initialized.
|
|
14
14
|
"""
|
|
15
|
+
|
|
15
16
|
from comtypes._post_coinit.unknwn import _shutdown # noqa
|
|
@@ -88,15 +88,9 @@ class IServiceProvider(IUnknown):
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
@overload
|
|
91
|
-
def CoGetObject(displayname: str, interface: None) -> IUnknown:
|
|
92
|
-
...
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
def CoGetObject(displayname: str, interface: None) -> IUnknown: ...
|
|
95
92
|
@overload
|
|
96
|
-
def CoGetObject(displayname: str, interface: Type[_T_IUnknown]) -> _T_IUnknown:
|
|
97
|
-
...
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
def CoGetObject(displayname: str, interface: Type[_T_IUnknown]) -> _T_IUnknown: ...
|
|
100
94
|
def CoGetObject(displayname: str, interface: Optional[Type[IUnknown]]) -> IUnknown:
|
|
101
95
|
"""Convert a displayname to a moniker, then bind and return the object
|
|
102
96
|
identified by the moniker."""
|
|
@@ -117,20 +111,14 @@ def CoCreateInstance(
|
|
|
117
111
|
interface: None = None,
|
|
118
112
|
clsctx: Optional[int] = None,
|
|
119
113
|
punkouter: Optional[_pUnkOuter] = None,
|
|
120
|
-
) -> IUnknown:
|
|
121
|
-
...
|
|
122
|
-
|
|
123
|
-
|
|
114
|
+
) -> IUnknown: ...
|
|
124
115
|
@overload
|
|
125
116
|
def CoCreateInstance(
|
|
126
117
|
clsid: GUID,
|
|
127
118
|
interface: Type[_T_IUnknown],
|
|
128
119
|
clsctx: Optional[int] = None,
|
|
129
120
|
punkouter: Optional[_pUnkOuter] = None,
|
|
130
|
-
) -> _T_IUnknown:
|
|
131
|
-
...
|
|
132
|
-
|
|
133
|
-
|
|
121
|
+
) -> _T_IUnknown: ...
|
|
134
122
|
def CoCreateInstance(
|
|
135
123
|
clsid: GUID,
|
|
136
124
|
interface: Optional[Type[IUnknown]] = None,
|
|
@@ -153,14 +141,19 @@ def CoCreateInstance(
|
|
|
153
141
|
if TYPE_CHECKING:
|
|
154
142
|
|
|
155
143
|
@overload
|
|
156
|
-
def CoGetClassObject(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
144
|
+
def CoGetClassObject(
|
|
145
|
+
clsid: GUID,
|
|
146
|
+
clsctx: Optional[int] = None,
|
|
147
|
+
pServerInfo: "Optional[COSERVERINFO]" = None,
|
|
148
|
+
interface: None = None,
|
|
149
|
+
) -> hints.IClassFactory: ...
|
|
160
150
|
@overload
|
|
161
|
-
def CoGetClassObject(
|
|
162
|
-
|
|
163
|
-
|
|
151
|
+
def CoGetClassObject(
|
|
152
|
+
clsid: GUID,
|
|
153
|
+
clsctx: Optional[int] = None,
|
|
154
|
+
pServerInfo: "Optional[COSERVERINFO]" = None,
|
|
155
|
+
interface: Type[_T_IUnknown] = hints.IClassFactory,
|
|
156
|
+
) -> _T_IUnknown: ...
|
|
164
157
|
|
|
165
158
|
|
|
166
159
|
def CoGetClassObject(clsid, clsctx=None, pServerInfo=None, interface=None):
|
|
@@ -177,15 +170,9 @@ def CoGetClassObject(clsid, clsctx=None, pServerInfo=None, interface=None):
|
|
|
177
170
|
|
|
178
171
|
|
|
179
172
|
@overload
|
|
180
|
-
def GetActiveObject(clsid: GUID, interface: None = None) -> IUnknown:
|
|
181
|
-
...
|
|
182
|
-
|
|
183
|
-
|
|
173
|
+
def GetActiveObject(clsid: GUID, interface: None = None) -> IUnknown: ...
|
|
184
174
|
@overload
|
|
185
|
-
def GetActiveObject(clsid: GUID, interface: Type[_T_IUnknown]) -> _T_IUnknown:
|
|
186
|
-
...
|
|
187
|
-
|
|
188
|
-
|
|
175
|
+
def GetActiveObject(clsid: GUID, interface: Type[_T_IUnknown]) -> _T_IUnknown: ...
|
|
189
176
|
def GetActiveObject(
|
|
190
177
|
clsid: GUID, interface: Optional[Type[IUnknown]] = None
|
|
191
178
|
) -> IUnknown:
|
|
@@ -335,10 +322,7 @@ def CoCreateInstanceEx(
|
|
|
335
322
|
clsctx: Optional[int] = None,
|
|
336
323
|
machine: Optional[str] = None,
|
|
337
324
|
pServerInfo: Optional[COSERVERINFO] = None,
|
|
338
|
-
) -> IUnknown:
|
|
339
|
-
...
|
|
340
|
-
|
|
341
|
-
|
|
325
|
+
) -> IUnknown: ...
|
|
342
326
|
@overload
|
|
343
327
|
def CoCreateInstanceEx(
|
|
344
328
|
clsid: GUID,
|
|
@@ -346,10 +330,7 @@ def CoCreateInstanceEx(
|
|
|
346
330
|
clsctx: Optional[int] = None,
|
|
347
331
|
machine: Optional[str] = None,
|
|
348
332
|
pServerInfo: Optional[COSERVERINFO] = None,
|
|
349
|
-
) -> _T_IUnknown:
|
|
350
|
-
...
|
|
351
|
-
|
|
352
|
-
|
|
333
|
+
) -> _T_IUnknown: ...
|
|
353
334
|
def CoCreateInstanceEx(
|
|
354
335
|
clsid: GUID,
|
|
355
336
|
interface: Optional[Type[IUnknown]] = None,
|
|
@@ -69,12 +69,37 @@ class _cominterface_meta(type):
|
|
|
69
69
|
def __new__(cls, name, bases, namespace):
|
|
70
70
|
methods = namespace.pop("_methods_", None)
|
|
71
71
|
dispmethods = namespace.pop("_disp_methods_", None)
|
|
72
|
-
|
|
72
|
+
self = type.__new__(cls, name, bases, namespace)
|
|
73
73
|
|
|
74
74
|
if methods is not None:
|
|
75
|
-
|
|
75
|
+
self._methods_ = methods
|
|
76
76
|
if dispmethods is not None:
|
|
77
|
-
|
|
77
|
+
self._disp_methods_ = dispmethods
|
|
78
|
+
|
|
79
|
+
# ` _compointer_meta` is a subclass inherited from `_cominterface_meta`.
|
|
80
|
+
# `_compointer_base` uses `_compointer_meta` as its metaclass.
|
|
81
|
+
# In other words, when the `__new__` method of this metaclass is called,
|
|
82
|
+
# `_compointer_base` type or an subclass of it might be created and assigned
|
|
83
|
+
# to `self`.
|
|
84
|
+
if bases == (c_void_p,):
|
|
85
|
+
# `self` is the `_compointer_base` type.
|
|
86
|
+
# On some versions of Python, `_compointer_base` is not yet available in
|
|
87
|
+
# the accessible namespace at this point in its initialization, and
|
|
88
|
+
# referencing it could raise a `NameError`.
|
|
89
|
+
# This metaclass is intended to be used only as a base class for defining
|
|
90
|
+
# the `_compointer_meta` or as the metaclass for the `IUnknown`, so the
|
|
91
|
+
# situation where the `bases` parameter is `(c_void_p,)` is limited to when
|
|
92
|
+
# the `_compointer_meta` is specified as the metaclass of the
|
|
93
|
+
# `_compointer_base`.
|
|
94
|
+
# Prevent specifying the metaclass type instance in the `bases` parameter
|
|
95
|
+
# when instantiating it, as this would lead to infinite recursion.
|
|
96
|
+
return self
|
|
97
|
+
if issubclass(self, _compointer_base):
|
|
98
|
+
# `self` is a `POINTER(interface)` type.
|
|
99
|
+
# Prevent creating/registering a pointer to a pointer (to a pointer...),
|
|
100
|
+
# which would lead to infinite recursion.
|
|
101
|
+
# Depending on a version or revision of Python, this may be essential.
|
|
102
|
+
return self
|
|
78
103
|
|
|
79
104
|
# If we sublass a COM interface, for example:
|
|
80
105
|
#
|
|
@@ -85,49 +110,67 @@ class _cominterface_meta(type):
|
|
|
85
110
|
# subclass of POINTER(IUnknown) because of the way ctypes
|
|
86
111
|
# typechecks work.
|
|
87
112
|
if bases == (object,):
|
|
88
|
-
|
|
113
|
+
# `self` is the `IUnknown` type.
|
|
114
|
+
_ptr_bases = (self, _compointer_base)
|
|
89
115
|
else:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
116
|
+
# `self` is an interface type derived from `IUnknown`.
|
|
117
|
+
_ptr_bases = (self, POINTER(bases[0]))
|
|
118
|
+
|
|
119
|
+
# The interface 'self' is used as a mixin.
|
|
120
|
+
# HACK: Could `type(_compointer_base)` be replaced with `_compointer_meta`?
|
|
121
|
+
# `type(klass)` returns its metaclass.
|
|
122
|
+
# Since this specification, `type(_compointer_base)` will return the
|
|
123
|
+
# `_compointer_meta` type as per the class definition.
|
|
124
|
+
# The reason for this implementation might be a remnant of the differences in
|
|
125
|
+
# how metaclasses work between Python 3.x and Python 2.x.
|
|
126
|
+
# If there are no problems with the versions of Python that `comtypes`
|
|
127
|
+
# supports, this replacement could make the process flow easier to understand.
|
|
93
128
|
p = type(_compointer_base)(
|
|
94
|
-
"POINTER(
|
|
129
|
+
f"POINTER({self.__name__})",
|
|
95
130
|
_ptr_bases,
|
|
96
|
-
{"__com_interface__":
|
|
131
|
+
{"__com_interface__": self, "_needs_com_addref_": None},
|
|
97
132
|
)
|
|
98
133
|
|
|
99
|
-
from ctypes import _pointer_type_cache
|
|
134
|
+
from ctypes import _pointer_type_cache # type: ignore
|
|
100
135
|
|
|
101
|
-
_pointer_type_cache[
|
|
136
|
+
_pointer_type_cache[self] = p
|
|
102
137
|
|
|
103
|
-
if
|
|
138
|
+
if self._case_insensitive_:
|
|
139
|
+
self._patch_case_insensitive_to_ptr_type(p)
|
|
140
|
+
self._patch_reference_fix_to_ptrptr_type(POINTER(p)) # type: ignore
|
|
104
141
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
142
|
+
return self
|
|
143
|
+
|
|
144
|
+
@staticmethod
|
|
145
|
+
def _patch_case_insensitive_to_ptr_type(p: Type) -> None:
|
|
146
|
+
@patcher.Patch(p)
|
|
147
|
+
class CaseInsensitive(object):
|
|
148
|
+
# case insensitive attributes for COM methods and properties
|
|
149
|
+
def __getattr__(self, name):
|
|
150
|
+
"""Implement case insensitive access to methods and properties"""
|
|
151
|
+
try:
|
|
152
|
+
fixed_name = self.__map_case__[name.lower()]
|
|
153
|
+
except KeyError:
|
|
154
|
+
raise AttributeError(name) # Should we use exception-chaining?
|
|
155
|
+
if fixed_name != name: # prevent unbounded recursion
|
|
156
|
+
return getattr(self, fixed_name)
|
|
157
|
+
raise AttributeError(name)
|
|
158
|
+
|
|
159
|
+
# __setattr__ is pretty heavy-weight, because it is called for
|
|
160
|
+
# EVERY attribute assignment. Settings a non-com attribute
|
|
161
|
+
# through this function takes 8.6 usec, while without this
|
|
162
|
+
# function it takes 0.7 sec - 12 times slower.
|
|
163
|
+
#
|
|
164
|
+
# How much faster would this be if implemented in C?
|
|
165
|
+
def __setattr__(self, name, value):
|
|
166
|
+
"""Implement case insensitive access to methods and properties"""
|
|
167
|
+
object.__setattr__(
|
|
168
|
+
self, self.__map_case__.get(name.lower(), name), value
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
@staticmethod
|
|
172
|
+
def _patch_reference_fix_to_ptrptr_type(pp: Type) -> None:
|
|
173
|
+
@patcher.Patch(pp)
|
|
131
174
|
class ReferenceFix(object):
|
|
132
175
|
def __setitem__(self, index, value):
|
|
133
176
|
# We override the __setitem__ method of the
|
|
@@ -149,13 +192,11 @@ class _cominterface_meta(type):
|
|
|
149
192
|
# CopyComPointer should do if index != 0.
|
|
150
193
|
if bool(value):
|
|
151
194
|
value.AddRef()
|
|
152
|
-
super(
|
|
195
|
+
super(pp, self).__setitem__(index, value) # type: ignore
|
|
153
196
|
return
|
|
154
197
|
from _ctypes import CopyComPointer
|
|
155
198
|
|
|
156
|
-
CopyComPointer(value, self)
|
|
157
|
-
|
|
158
|
-
return new_cls
|
|
199
|
+
CopyComPointer(value, self) # type: ignore
|
|
159
200
|
|
|
160
201
|
def __setattr__(self, name, value):
|
|
161
202
|
if name == "_methods_":
|
|
@@ -308,16 +349,13 @@ class _cominterface_meta(type):
|
|
|
308
349
|
|
|
309
350
|
def __get_baseinterface_methodcount(self):
|
|
310
351
|
"Return the number of com methods in the base interfaces"
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
result += len(itf
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
if name == "_methods_":
|
|
319
|
-
raise TypeError("baseinterface '%s' has no _methods_" % itf.__name__)
|
|
320
|
-
raise
|
|
352
|
+
result = 0
|
|
353
|
+
for itf in self.mro()[1:-1]:
|
|
354
|
+
if "_methods_" in vars(itf):
|
|
355
|
+
result += len(vars(itf)["_methods_"])
|
|
356
|
+
else:
|
|
357
|
+
raise TypeError(f"baseinterface '{itf.__name__}' has no _methods_")
|
|
358
|
+
return result
|
|
321
359
|
|
|
322
360
|
def _make_methods(self, methods: List[_ComMemberSpec]) -> None:
|
|
323
361
|
if self._case_insensitive_:
|
|
@@ -363,9 +401,11 @@ class _cominterface_meta(type):
|
|
|
363
401
|
################################################################
|
|
364
402
|
|
|
365
403
|
|
|
404
|
+
# will not work if we change the order of the two base classes!
|
|
366
405
|
class _compointer_meta(type(c_void_p), _cominterface_meta):
|
|
367
|
-
"metaclass for COM interface pointer classes"
|
|
368
|
-
|
|
406
|
+
"""metaclass for COM interface pointer classes"""
|
|
407
|
+
|
|
408
|
+
pass # no functionality, but needed to avoid a metaclass conflict
|
|
369
409
|
|
|
370
410
|
|
|
371
411
|
class _compointer_base(c_void_p, metaclass=_compointer_meta):
|
|
@@ -385,21 +425,6 @@ class _compointer_base(c_void_p, metaclass=_compointer_meta):
|
|
|
385
425
|
_debug("Release %s", self)
|
|
386
426
|
self.Release()
|
|
387
427
|
|
|
388
|
-
def __cmp__(self, other):
|
|
389
|
-
"""Compare pointers to COM interfaces."""
|
|
390
|
-
# COM identity rule
|
|
391
|
-
#
|
|
392
|
-
# XXX To compare COM interface pointers, should we
|
|
393
|
-
# automatically QueryInterface for IUnknown on both items, and
|
|
394
|
-
# compare the pointer values?
|
|
395
|
-
if not isinstance(other, _compointer_base):
|
|
396
|
-
return 1
|
|
397
|
-
|
|
398
|
-
# get the value property of the c_void_p baseclass, this is the pointer value
|
|
399
|
-
return cmp(
|
|
400
|
-
super(_compointer_base, self).value, super(_compointer_base, other).value
|
|
401
|
-
)
|
|
402
|
-
|
|
403
428
|
def __eq__(self, other):
|
|
404
429
|
if not isinstance(other, _compointer_base):
|
|
405
430
|
return False
|
|
@@ -138,22 +138,17 @@ wrap = GetBestInterface
|
|
|
138
138
|
# Should we do this for POINTER(IUnknown) also?
|
|
139
139
|
ctypes.POINTER(automation.IDispatch).__ctypes_from_outparam__ = wrap_outparam # type: ignore
|
|
140
140
|
|
|
141
|
+
|
|
141
142
|
################################################################
|
|
142
143
|
#
|
|
143
144
|
# Object creation
|
|
144
145
|
#
|
|
145
146
|
@overload
|
|
146
|
-
def GetActiveObject(progid: _UnionT[str, CoClass, GUID]) -> Any:
|
|
147
|
-
...
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
def GetActiveObject(progid: _UnionT[str, CoClass, GUID]) -> Any: ...
|
|
150
148
|
@overload
|
|
151
149
|
def GetActiveObject(
|
|
152
150
|
progid: _UnionT[str, CoClass, GUID], interface: Type[_T_IUnknown]
|
|
153
|
-
) -> _T_IUnknown:
|
|
154
|
-
...
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
) -> _T_IUnknown: ...
|
|
157
152
|
def GetActiveObject(
|
|
158
153
|
progid: _UnionT[str, CoClass, GUID],
|
|
159
154
|
interface: Optional[Type[IUnknown]] = None,
|
|
@@ -193,14 +188,19 @@ def _manage(
|
|
|
193
188
|
if TYPE_CHECKING:
|
|
194
189
|
|
|
195
190
|
@overload
|
|
196
|
-
def GetClassObject(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
191
|
+
def GetClassObject(
|
|
192
|
+
progid: _UnionT[str, CoClass, GUID],
|
|
193
|
+
clsctx: Optional[int] = None,
|
|
194
|
+
pServerInfo: Optional[comtypes.COSERVERINFO] = None,
|
|
195
|
+
interface: None = None,
|
|
196
|
+
) -> hints.IClassFactory: ...
|
|
200
197
|
@overload
|
|
201
|
-
def GetClassObject(
|
|
202
|
-
|
|
203
|
-
|
|
198
|
+
def GetClassObject(
|
|
199
|
+
progid: _UnionT[str, CoClass, GUID],
|
|
200
|
+
clsctx: Optional[int] = None,
|
|
201
|
+
pServerInfo: Optional[comtypes.COSERVERINFO] = None,
|
|
202
|
+
interface: Type[_T_IUnknown] = hints.IClassFactory,
|
|
203
|
+
) -> _T_IUnknown: ...
|
|
204
204
|
|
|
205
205
|
|
|
206
206
|
def GetClassObject(progid, clsctx=None, pServerInfo=None, interface=None):
|
|
@@ -216,10 +216,7 @@ def GetClassObject(progid, clsctx=None, pServerInfo=None, interface=None):
|
|
|
216
216
|
|
|
217
217
|
|
|
218
218
|
@overload
|
|
219
|
-
def CreateObject(progid: _UnionT[str, Type[CoClass], GUID]) -> Any:
|
|
220
|
-
...
|
|
221
|
-
|
|
222
|
-
|
|
219
|
+
def CreateObject(progid: _UnionT[str, Type[CoClass], GUID]) -> Any: ...
|
|
223
220
|
@overload
|
|
224
221
|
def CreateObject(
|
|
225
222
|
progid: _UnionT[str, Type[CoClass], GUID],
|
|
@@ -228,10 +225,7 @@ def CreateObject(
|
|
|
228
225
|
interface: Optional[Type[_T_IUnknown]] = None,
|
|
229
226
|
dynamic: bool = ...,
|
|
230
227
|
pServerInfo: Optional[comtypes.COSERVERINFO] = None,
|
|
231
|
-
) -> _T_IUnknown:
|
|
232
|
-
...
|
|
233
|
-
|
|
234
|
-
|
|
228
|
+
) -> _T_IUnknown: ...
|
|
235
229
|
def CreateObject(
|
|
236
230
|
progid: _UnionT[str, Type[CoClass], GUID], # which object to create
|
|
237
231
|
clsctx: Optional[int] = None, # how to create the object
|
|
@@ -297,15 +291,11 @@ def CreateObject(
|
|
|
297
291
|
|
|
298
292
|
|
|
299
293
|
@overload
|
|
300
|
-
def CoGetObject(displayname: str, interface: Type[_T_IUnknown]) -> _T_IUnknown:
|
|
301
|
-
...
|
|
302
|
-
|
|
303
|
-
|
|
294
|
+
def CoGetObject(displayname: str, interface: Type[_T_IUnknown]) -> _T_IUnknown: ...
|
|
304
295
|
@overload
|
|
305
|
-
def CoGetObject(
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
296
|
+
def CoGetObject(
|
|
297
|
+
displayname: str, interface: None = None, dynamic: bool = False
|
|
298
|
+
) -> Any: ...
|
|
309
299
|
def CoGetObject(
|
|
310
300
|
displayname: str,
|
|
311
301
|
interface: Optional[Type[comtypes.IUnknown]] = None,
|