Python Ctypes-Ladebibliothek
Ich benutze Windows 7 64-Bit-Maschine. Ich installierte Visual Studio 2010 und entwickelte eine einfache Win32-DLL, um 2 Zahlen hinzuzufügen. Die DLL wurde erstellt und ich verwendete eine Testanwendung, um die DLL zu testen, und sie funktioniert gut.
Jetzt schreibe ich Python-Skript (siehe unten), um diese Bibliothek zu verwenden. Aber ich bekomme folgende Fehlermeldung.
Traceback (most recent call last):
File "C:\Users\sbritto\Documents\Visual Studio 2008\Projects\MathFuncsDll\Debug\MathFuncs.py", line 5, in <module>
lib = ctypes.WinDLL('MathFuncsDll.dll',use_last_error=True)
File "C:\Python27\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 193] %1 is not a valid Win32 application
Python-Skript
import ctypes
from ctypes import *
#lib = cdll.LoadLibrary("MathFuncsDll.dll")
lib = ctypes.WinDLL('MathFuncsDll.dll',use_last_error=True)
print lib
Bitte lassen Sie mich so schnell wie möglich wissen.
Danke im Voraus