Skip to content

Commit

Permalink
Split documentation into multiple pages. (#722)
Browse files Browse the repository at this point in the history
* Revive `com_interfaces.txt` from `3c916f61`.
Run `git revert 3c916f6` and cherry-pick `com_interfaces.txt`.

* `git mv docs/com_interfaces.txt docs/source/com_interfaces.rst`

* Remove the "Case sensitivity" section from `client.rst`, since it exists in `com_interfaces.rst`.

* Update Overview.

* Fix typo.

* Update section underline characters in `com_interfaces.rst`.

* Update indentations and enclosures in `com_interfaces.rst`.

* Improve code blocks in `com_interfaces.rst`.

* Add `com_interfaces` to `toctree::`.

* Fix code block in `server.rst`.
  • Loading branch information
junkmd authored Dec 26, 2024
1 parent 1767acf commit 49d819c
Show file tree
Hide file tree
Showing 4 changed files with 429 additions and 29 deletions.
28 changes: 0 additions & 28 deletions docs/source/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -649,34 +649,6 @@ by ``py2exe``:
>>> import comtypes.gen.Scripting


Case sensitivity
++++++++++++++++

In principle, COM is a case insensitive technology (probably because
of Visual Basic). Type libraries generated from IDL files, however,
do *not* always even preserve the case of identifiers; see for example
http://support.microsoft.com/kb/220137.

Python (and C/C++) are case sensitive languages, so |comtypes| is also
case sensitive. This means that you have to call
``obj.QueryInterface(...)``, it will not work to write
``obj.queryinterface(...)``.

To work around the problems that you get when the case of identifiers
in the type library (and in the generated Python module for this
library) is not the same as in the IDL file, |comtypes| allows to have
case insensitive attribute access for methods and properties in COM
interfaces. This behaviour is enabled by setting the
``_case_insensitive_`` attribute of a Python COM interface to
``True``. In case of derived COM interfaces, case sensitivity is
enabled or disabled separately for each interface.

The code generated by the ``GetModule`` function sets this attribute
to ``True``. Case insensitive access has a small performance penalty,
if you want to avoid this, you should edit the generated code and set
the ``_case_insensitive_`` attribute to ``False``.


Other stuff
***********

Expand Down
Loading

0 comments on commit 49d819c

Please sign in to comment.