I'm learning ctypes right now and have made simple function and here is the code
#import ctypes module
import ctypes as ct
#get BOOL C++ value from ctypes
from ctypes.wintypes import BOOL
#Loading the DLL see: http://www.daniweb.com/forums/thread160430.html
bass_dll = ct.cdll.bass
#here is function description on the function
""" Loads a WAV, AIFF, MP3, MP2, MP1, OGG or plugin supported sample.
HSAMPLE BASS_SampleLoad(
BOOL mem,
void *file,
QWORD offset,
DWORD length,
DWORD max,
DWORD flags
);
CFUNCTYPE(restype, *argtypes)
"""
#The rguments list
res = bass_dll.BASS_SampleLoad.restype = [ct.c_int]
args = bass_dll.BASS_SampleLoad.argtypes = [BOOL, ct.c_char_p, ct.c_int, ct.c_int, ct.c_int, ct.c_char_p]
prototype = ct.CFUNCTYPE(res, args)
print prototype
when I run I get error:
TypeError: restype must be a type, a callable, or None
I dont know what is wrong, so need help!