为32位和64位系统编程. [英] programing for 32 and 64 bit system.

查看:59
本文介绍了为32位和64位系统编程.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友:

我正忙于编写Windows应用程序,不知道如何在程序中包含32位和64位系统配置.如果有人可以帮助我应对这一挑战,我将非常高兴.


热烈的问候.

Dear Friends:

I am in the trenches of writing windows application program and I do not know how to include 32 and 64 bit system configuration in my program. I would be really happy if any one can help me to handle this challenge.


Warmly Regard.

推荐答案

除了Mehdi的解决方案和Simon的重要说明:

您不能在一个过程中混合使用不同的指令集架构.支持两种64位指令集体系结构:Itaniun(IA-64, http://en.wikipedia.org/wiki/Itanium [ ^ ];)和x86-64( http://en.wikipedia.org/wiki/X86-64 [ http://en.wikipedia.org/wiki/WOW64 [
In addition to the solution by Mehdi and important note by Simon:

You cannot mix up different instruction-set architectures in one process. Supported are two 64-bit instruction-set architectures: Itaniun (IA-64, http://en.wikipedia.org/wiki/Itanium[^];) and x86-64 (http://en.wikipedia.org/wiki/X86-64[^]) as well as 32-bit (x86), which is provided on 64-bit versions of Windows via WoW64 (http://en.wikipedia.org/wiki/WOW64[^]). Both 64-bit architecture are incompatible to each other, but x86 on each of 64 versions of Windows is the same, so it''s often uses as a common denominator.

If you break this rule, it''s worse than just incompatibility: the solution can be built but will crash during run time.

If at least one of the referenced assemblies uses different instruction-set architecture, it will also crash. AnyCPU is interesting: when all assemblies are targeted to AnyCPU, actual instruction-set architecture will be selected by OS, but if an entry assembly is targeted to specific instruction-set architecture, it will make the choice. This is very important feature helping to run and, say, test library assemblies for different machines.

—SA


在.net中,如果您使用Any CPU,则无需担心32位和64位,因为您的程序集可以使用两者和安装在目标系统上的运行时都将完成所有工作.
In .net if you go for the Any CPU you don''t need to worry about 32 and 64 bit as your assembly will work with both and the runtime installed on your target system will do all the work.


这篇关于为32位和64位系统编程.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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