python支持32位么,我可以在64位python中使用32位dll或exe吗?

When I use CDLL to call 32bit dll in 32bit python, it works well.

But unfortunatelly in my 64bit win7 os only installs 64bit python, when calling it turns: it is not a effective win32 app!

Can I use 32bit dll or exe in 64bit python? Or I have to install 32bit python instead?

解决方案

64-bit EXEs cannot load 32-bit DLLs. (And vice versa: 32-bit EXEs cannot load 64-bit DLLs.) After all, they can't agree on the size of a pointer -- what would happen if the EXE allocated memory above the 4GB boundary and wanted to pass that pointer to the 32-bit DLL?

You'll have to either:

Make a 64-bit version of your DLL;

Use a 32-bit version of Python; or

Host the DLL in a separate (32-bit) EXE, and use some form of inter-process communication to talk to it from your 64-bit Python process.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值