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

问题描述

当我创建一个指向 user32.dll中比如我要建立这个带有签名 user64.dll 如果目标是64位计算机?

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位,由于从供应商(进度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.

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

09-27 16:30