python-2.7python-cfficffile

Getting this error *** OSError: cannot load library C:\WINDOWS\libzsfc.dll: error 0xc1


I am trying to load a .dll file using python cffi library, but whiele I am trying to load it I am getting following error:-

    *** OSError: cannot load library C:\WINDOWS\libzsfc.dll: error 0xc1

I am using this

from cffi import FFI
ffi = FFI()
lib = ffi.dlopen("libzsfc.dll")

but this giving me error, I tried a lot to resolve this, but it remains same, please let me know if anyone faced same issue.


Solution

  • I think you have to first register the dll in windows then load will work fine.

    To register the same use command regsvr32 <complete dll path>

    Use Regsvr32.exe from the %SystemRoot%\Syswow64 folder. For example, type the following commands to register the DLL: cd \windows\syswow64 regsvr32 c:\filename.dll