#include <stdio.h>
typedef struct TestDLL_
{
int a;
char *b;
} testdll;
testdll test(testdll t)
{
t.a=t.a+t.a;
printf("%d\n%s\n",t.a,t.b);
return t;
}
from ctypes import *
dllpath='test.dll'
dll=CDLL(dllpath)
a=c_int(125)
b=c_char_p('Hello world,Hello Chengdu')
class testdll(Structure):
_fields_=[('a',c_int),
('b',c_char_p)]
t=testdll()
t.a=a
t.b=b
dll.test.restype=testdll
t=dll.test(t)
print t.a
print t.b
x=raw_input('any key to continue')