diff --git a/docs/source/com_interfaces.rst b/docs/source/com_interfaces.rst index 056b0a8a..c5a18d70 100644 --- a/docs/source/com_interfaces.rst +++ b/docs/source/com_interfaces.rst @@ -68,6 +68,26 @@ The ``IUnknown`` as a Python class of ``-2147467262`` (``E_NOINTERFACE``, ``'0x80004002'`` in signed-32bit hex) + .. doctest:: + + >>> from comtypes.client import CreateObject, GetModule + >>> from comtypes import IUnknown + >>> from comtypes.automation import IDispatch + >>> GetModule('scrrun.dll') # doctest: +ELLIPSIS + + >>> from comtypes.gen import Scripting + >>> dic = CreateObject(Scripting.Dictionary) + >>> dic # doctest: +ELLIPSIS + + >>> dic.QueryInterface(IDispatch) # doctest: +ELLIPSIS + + >>> dic.QueryInterface(IUnknown) # doctest: +ELLIPSIS + + >>> dic.QueryInterface(Scripting.IFileSystem) # doctest: +ELLIPSIS + Traceback (most recent call last): + ... + _ctypes.COMError: (-2147467262, ..., (None, None, None, 0, None)) + .. py:method:: Add() This wraps the `IUnknown::AddRef `_.