Note that there are some explanatory texts on larger screens.

plurals
  1. POType mismatch error when using win32com.client.gencache.EnsureDispatch
    primarykey
    data
    text
    <p>I'm trying to interact with the COM interface of a proprietary application using the win32com module. I can connect to the interface using the dynamic proxy (win32com.client.Dispatch), which appears to work. However, it would be useful if I could use a static proxy, not least because it populates the help() pages.</p> <p>I can interact normally with the dynamic proxy:</p> <pre><code>&gt;&gt;&gt; import win32com.client &gt;&gt;&gt; aqt = win32com.client.Dispatch("Aquator.Application") &gt;&gt;&gt; db = aqt.LoadDatabase(Folder=r"D:\Shared", Name="AquatorExcel.mdb") &gt;&gt;&gt; db.Name u'D:\\Shared\\AquatorExcel.mdb' &gt;&gt;&gt; db.GetProjectList() (1, (3,), (u'A simple model',)) </code></pre> <p>But when I use the static proxy generated using EnsureDispatch or the makepy script, I get this error:</p> <pre><code>&gt;&gt;&gt; import win32com.client &gt;&gt;&gt; aqt = win32com.client.gencache.EnsureDispatch("Aquator.Application") &gt;&gt;&gt; db.Name u'D:\\Shared\\AquatorExcel.mdb' &gt;&gt;&gt; db = aqt.LoadDatabase(Folder=r"D:\Shared", Name="AquatorExcel.mdb") &gt;&gt;&gt; db.GetProjectList() Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "C:\Program Files\Pythonxy\Pythonxy 2.7\Python27\lib\site-packages\win32c om\gen_py\AE9A7F2A-5DD7-4658-B55C-216CAD680889x0x4x3\_Database.py", line 70, in GetProjectList , NameList) File "C:\Program Files\Pythonxy\Pythonxy 2.7\Python27\lib\site-packages\win32c om\client\__init__.py", line 456, in _ApplyTypes_ self._oleobj_.InvokeTypes(dispid, 0, wFlags, retType, argTypes, *args), pywintypes.com_error: (-2147352571, 'Type mismatch.', None, 1) </code></pre> <p>I'm fairly new to COM in general, so I really have no idea where to go from here. What is causing this error and how can I avoid it?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload