Why ctypes always returns True?

zhangxaochen <[email protected]> Thu, 15 Aug 2013 19:26:47 +0800 (CST)
Newsgroups gmane.comp.python.ctypes
Message-ID <[email protected]>
My c code is:
    extern "C" __declspec(dllexport) bool isTrue( bool b){ return b; }

py code is:
    lib=ctypes.cdll.LoadLibrary('xx.dll') #dll generated from the c code above

    b=lib.isTrue(False) 
    print c_bool(b).value


no matter i call lib.isTrue() with True or False, the output is always 'True'.....
could someone explain?










发件人:张琛
联系电话:13575752056(杭州)
联系地址:浙江省杭州市西湖区浙大路38号  浙大玉泉校区32舍203       邮编:310027
MOTTO:There is no secret ingredient...

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk

_______________________________________________
ctypes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ctypes-users