64 位 Windows 上的 P/Invoke 是否需要与 32 位不同的签名? [英] Does P/Invoke on 64-bit windows require different signatures than on 32-bit?

查看:15
本文介绍了64 位 Windows 上的 P/Invoke 是否需要与 32 位不同的签名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,当我创建一个引用 user32.dll 的签名时,如果目标是 64 位计算机,我是否应该使用 user64.dll 构建它?

When I create a signature that refers to user32.dll for example should I be building this with user64.dll if the target is a 64-bit computer?

[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern bool ChangeClipboardChain(
    IntPtr hWndRemove,
    IntPtr hWndNewNext);

目前这不是问题,因为我只针对 32 位,因为供应商 (Progress OpenEdge) 的库仅提供 32 位库来访问他们的数据库.

Currently this isn't a problem as I'm targeting only 32-bit due to a library from a vendor (Progress OpenEdge) which only provide 32-bit libraries to access their database.

我目前没有 64 位 Windows 计算机,无法查看是否是这种情况.

I don't currently have a 64-bit windows computer to see if this is the case.

推荐答案

尽管有命名约定,user32.dll(和其他 32... dll)在 64 位机器上实际上是 64 位的.这些是 dll 的历史名称,并且无论底层架构如何变化都保持这种方式.阅读这个页面以获取更多详细信息.

Despite the naming convention, user32.dll (and other 32... dlls) are actually 64 bit on 64 bit machines. These are the historical names for the dlls, and have been kept that way regardless of the changes to the underlying architecture. Have a read of this page to get more details.

这篇关于64 位 Windows 上的 P/Invoke 是否需要与 32 位不同的签名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆