Code: Select all
#!/usr/bin/python
from ctypes import *
print cdll.DevIL
print 'iBindImageTemp', cdll.DevIL.iBindImageTemp
print '_iFlipBuffer@16 by ordinal',cdll.DevIL[5]
print '_iFlipBuffer@16 by name', getattr(cdll.DevIL, "_iFlipBuffer@16")
Output of this program:
Code: Select all
<CDLL 'DevIL', handle 10000000 at ad6810>
iBindImageTemp <_FuncPtr object at 0x00A6DBE8>
_iFlipBuffer@16 by ordinal <_FuncPtr object at 0x00A6DC60>
_iFlipBuffer@16 by name
Traceback (most recent call last):
File "unitsynctest.py", line 8, in <module>
print '_iFlipBuffer@16 by name', getattr(cdll.DevIL, "_iFlipBuffer@16")
File "C:\Python25\lib\ctypes\__init__.py", line 325, in __getattr__
func = self.__getitem__(name)
File "C:\Python25\lib\ctypes\__init__.py", line 330, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function '_iFlipBuffer@16' not found
Code: Select all
#!/usr/bin/python
from ctypes import *
# windll uses stdcall
print windll.unitsync