Note that there are some explanatory texts on larger screens.

plurals
  1. POError with python Comtypes CreateObject
    primarykey
    data
    text
    <p>I have a C# dll registered on COM which i am trying to use in Python code using comtypes , the code works perfectly fine in the machine i am developing the c# dll but fails to load when deployed in a different machine with all the required files .</p> <p>Here is the error i am getting</p> <pre><code>Traceback (most recent call last): File "C:\Python27\Lib\site-packages\bellagio\DriverManager\audiotest\apx525\apx525_Wrapper.py", line 257, in &lt;module&gt; c._Connect() File "C:\Python27\Lib\site-packages\bellagio\DriverManager\audiotest\apx525\apx525_Wrapper.py", line 51, in _Connect self.apx525 = CreateObject("APxWrapper.APxWrapper",None,None,apx.IAPxWrapper) File "C:\Python27\lib\site-packages\comtypes\client\__init__.py", line 235, in CreateObject obj = comtypes.CoCreateInstance(clsid, clsctx=clsctx, interface=interface) File "C:\Python27\lib\site-packages\comtypes\__init__.py", line 1145, in CoCreateInstance _ole32.CoCreateInstance(byref(clsid), punkouter, clsctx, byref(iid), byref(p)) File "_ctypes/callproc.c", line 936, in GetResult WindowsError: [Error -2147024894] The system cannot find the file specified </code></pre> <p>and the corresponding python code is </p> <pre><code>try: from comtypes.client import CreateObject,GetModule, Constants, GetEvents from comtypes import COMError GetModule("P:\\Share\\Test\\TestBed\\Bellagio\\dll\\APxWrapper.tlb") from comtypes.gen import APxWrapper as apx except: tblog.warnLog("Need to install comtypes package, AP driver not imported") class IAPxWrapper_Impl(object): def __init__(self): self.apx525 = None self.activeSignalPath = '' self.activeMeasurement = '' def _Connect(self): self.apx525 = CreateObject("APxWrapper.APxWrapper",None,None,apx.IAPxWrapper) self.apx525._GUIVisible = True; return True c = IAPxWrapper_Impl() c._Connect() </code></pre> <p>Note that the folder has 3 files ApxWrapper.tlb .APxWrapper.dll and a dependency dll . GetModule works fine and pyton files are generated in comtypes.gen folder Any hints on this highly appreciated</p> <p>Sanjay</p>
    singulars
    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.
    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