diff --git a/docs/source/client.rst b/docs/source/client.rst index 1e9704aa..b790279c 100644 --- a/docs/source/client.rst +++ b/docs/source/client.rst @@ -47,8 +47,8 @@ access COM objects. Create a named COM object and returns an interface pointer to it. For the interpretation of ``displayname`` consult the Microsoft documentation for the Windows ``CoGetObject`` function. - ``"winmgmts:"``, for example, is the displayname for `WMI - monikers`_: + ``"winmgmts:"``, for example, is the displayname for + `WMI monikers `_: .. sourcecode:: python @@ -258,8 +258,12 @@ VT_INT``, or an array a strings with typecode ``VT_ARRAY | VT_BSTR``. To create these variants you must pass an instance of the Python ``array.array`` with the correct Python typecode to the COM method. -Note that NumPy arrays are also an option here, as is described in -the following section. + +.. note:: + + NumPy arrays are also an option, as described in the + :doc:`npsupport` document. + The mapping of the ``array.array`` typecode to the ``VARIANT`` typecode is defined in the ``comtypes.automation`` module by a @@ -339,8 +343,7 @@ based on so-called *connection points*. .. note:: For the rules that you should observe when implementing event - handlers you should read the implementing_COM_methods_ section in - the |comtypes| server document. + handlers you should read the :doc:`server` document. ``GetEvents(source, sink, interface=None)`` @@ -476,9 +479,13 @@ and passes it as second parameter to the ``GetEvents()`` function: FontChanged Name -Note that event handler methods support the same calling convention as -COM method implementations in |comtypes|. So the remarks about -implementing_COM_methods_ should be observed. +.. note:: + + Event handler methods support the same calling convention as COM + method implementations in |comtypes|. So the remarks about the + `"Implementing COM methods" section in the server document `_ + should be observed. + Typelibraries ************* @@ -532,9 +539,9 @@ from COM typelibraries. abstracted alias ``__wrapper_module__``, also imports interface classes, coclasses, constants, and structures from the wrapper module, and defines enumerations from typeinfo of the typelibrary - using `enum.IntFlag`_. The friendly module can be imported - easier than the wrapper module because the module name is easier - to type and read. + using `enum.IntFlag `_. + The friendly module can be imported easier than the wrapper + module because the module name is easier to type and read. For example, the typelibrary for Scripting Runtime has the name ``Scripting`` (this is the name specified in the type library @@ -659,9 +666,3 @@ XXX describe logging, gen_dir, wrap, _manage (?) .. |comtypes| replace:: ``comtypes`` - -.. _`WMI monikers`: http://www.microsoft.com/technet/scriptcenter/guide/sas_wmi_jgfx.mspx?mfr=true - -.. _`enum.IntFlag`: https://docs.python.org/3/library/enum.html#enum.IntFlag - -.. _implementing_COM_methods: server.html#implementing-com-methods diff --git a/docs/source/index.rst b/docs/source/index.rst index 02f61dea..6a546b67 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -2,13 +2,15 @@ The ``comtypes`` package ######################## -|comtypes| is a *pure Python* COM package based on the ctypes_ ffi +|comtypes| is a *pure Python* COM package based on the +`ctypes `_ ffi foreign function library. |ctypes| is included in Python 2.5 and later, it is also available for Python 2.4 as separate download. -While the pywin32_ package contains superior client side support -for *dispatch based* COM interfaces, it is not possible to access -*custom* COM interfaces unless they are wrapped in C++-code. +While the `pywin32 `_ package +contains superior client side support for *dispatch based* COM +interfaces, it is not possible to access *custom* COM interfaces +unless they are wrapped in C++-code. The |comtypes| package makes it easy to access and implement both custom and dispatch based COM interfaces. @@ -46,18 +48,22 @@ Chen, Alicia (2012). `"Comtypes: How Dropbox learned to stop worrying and love t Downloads ********* -The |comtypes| project is hosted on github_. Releases can be downloaded from -the github releases_ section. +The |comtypes| project is hosted on `GitHub `_. +Releases can be downloaded from the `GitHub releases `_ +section. -.. |comtypes| replace:: ``comtypes`` +Installation +************ -.. |ctypes| replace:: ``ctypes`` +|comtypes| is available on `PyPI `_ and +can be installed with ``pip``: -.. _ctypes: https://docs.python.org/3/library/ctypes.html +.. sourcecode:: shell -.. _pywin32: https://pypi.org/project/pywin32/ + pip install comtypes -.. _github: https://github.com/enthought/comtypes -.. _releases: https://github.com/enthought/comtypes/releases +.. |comtypes| replace:: ``comtypes`` + +.. |ctypes| replace:: ``ctypes`` diff --git a/docs/source/server.rst b/docs/source/server.rst index d7b1de9d..f732acb8 100644 --- a/docs/source/server.rst +++ b/docs/source/server.rst @@ -187,7 +187,7 @@ COM event handlers! In the IDL file, the method signature is defined like this: -.. sourcecode:: c +.. sourcecode:: idl HRESULT MyMethod([in] INT a, [in] INT b, [out, retval] INT *presult);