Message133593
| Author |
santoso.wijaya |
| Recipients |
Abraham.Soedjito, santoso.wijaya, theller |
| Date |
2011年04月12日.18:06:30 |
| SpamBayes Score |
2.1062139e-08 |
| Marked as misclassified |
No |
| Message-id |
<1302631591.3.0.329990747568.issue11835@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
32-bit (2.6) is fine:
D:\Temp\cdll\Release>C:\Python26\python.exe
Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> libcdll = CDLL('cdll')
>>> class MyStruct(Structure):
... _fields_ = []
... for name in ('a', 'b', 'c', 'd', 'e', 'f', 'g'):
... _fields_.append((name, c_int32))
...
>>> MyStruct._fields_
[('a', <class 'ctypes.c_long'>), ('b', <class 'ctypes.c_long'>), ('c', <class 'c
types.c_long'>), ('d', <class 'ctypes.c_long'>), ('e', <class 'ctypes.c_long'>),
('f', <class 'ctypes.c_long'>), ('g', <class 'ctypes.c_long'>)]
>>> s1 = MyStruct(1, 2, 3, 4, 5, 6, 7)
>>> s2 = MyStruct(0, 9, 8, 7, 6, 5, 4)
>>> libcdll.errorPassingParameter(s1, s2, 42)
s1.a: 1; s1.b: 2; s1.c: 3; s1.d: 4; s1.e: 5; s1.f: 6; s1.g: 7
s2.a: 0; s2.b: 9; s2.c: 8; s2.d: 7; s2.e: 6; s2.f: 5; s2.g: 4
x: 42
0
>>> |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年04月12日 18:06:31 | santoso.wijaya | set | recipients:
+ santoso.wijaya, theller, Abraham.Soedjito |
| 2011年04月12日 18:06:31 | santoso.wijaya | set | messageid: <1302631591.3.0.329990747568.issue11835@psf.upfronthosting.co.za> |
| 2011年04月12日 18:06:30 | santoso.wijaya | link | issue11835 messages |
| 2011年04月12日 18:06:30 | santoso.wijaya | create |
|