Search code examples
pythondllcom

Python DLL registration problems


I have a piece of hardware which I am trying to control over USB. The vendor provides a set of DLL files which can be used for this purpose.

I have found Win32com , how select coclass interface?, that someone else has done what I want to do. Here they are using win32com.client.Dispatch("BK.BasicEnv.Application.RemoteAPI") in order to create the RemoteAPI object. However when I try this, I get the error 'Class not registered'.

If I try to register the DLL which contains RemoteAPI using regsvr32 I get the error "The module "BasicEnvRemoteAPI.dll" was loaded but the entry-point DllRegisterServer was not found". If I try with /i /n, I get that DllInstall was not found.

So I cannot create the object I want because the DLL is not registered... but I cannot register the DLL?

How do I register the DLL?


Solution

  • The system is telling you that this DLL does not implement a COM server. If it did, then it would export a function named DllRegisterServer that would perform self-registration. You'll need to go back to the documentation for this hardware, or whoever supplied you with the accompanying software, to work out how you are meant to register the COM server.

    All the evidence points to your DLL not implementing a COM server.

    Update

    Your comments suggest that this is in fact a managed DLL. In which case you should register it with regasm.