如何使用python ctypes从.dll调用函数

时间:2018-01-30 02:45:27

标签: python dll ctypes

Interop.zkemkeeper.dll

function

error

无论我做什么,找不到功能'BackupData',帮帮我,谢谢! 代码:

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from ctypes import *

zk = WinDLL('Interop.zkemkeeper.dll')
r = zk.BackupDat
print zk,r

结果:

E:\Workspace\pycharm\door\Scripts\python.exe 
E:/Workspace/pycharm/door/mydoor/demo.py
Traceback (most recent call last):
 File "E:/Workspace/pycharm/door/mydoor/demo.py", line 6, in <module>
  r = zk.BackupDat
 File "c:\python27\Lib\ctypes\__init__.py", line 375, in __getattr__
  func = self.__getitem__(name)
 File "c:\python27\Lib\ctypes\__init__.py", line 380, in __getitem__
  func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'BackupDat' not found

Process finished with exit code 1

0 个答案:

没有答案