platform dependent calls and environment detection

G

Guest

i would like to my c# project to have the Platform target be set to any cpu.
i would like to detect at run-time whether the environment is x86, x64 or
Itanium,
any ideas?
 
N

Nicholas Paldino [.NET/C# MVP]

Joe,

You can set the platform target as you wish, and AFAIK, it should run
fine with little changes (although there are caveats with all things,
depending on what you do).

As for determining what the platform is, you can use the classes in the
System.Management namespace to determine the processor type (specifically,
the Win32_Processor WMI class).

Hope this helps.
 
W

Willy Denoyette [MVP]

|i would like to my c# project to have the Platform target be set to any
cpu.
| i would like to detect at run-time whether the environment is x86, x64 or
| Itanium,
| any ideas?

Why would you ever need this?
If you wan't to run on any platform, your code must be built using 'anycpu'
as target platform, so what's the use of knowing the platform at run-time?


Willy.
 
N

not_a_commie

Can you make native DLL calls in XBAP?

I think you should refactor the DLL. I doubt you have that many places
where pointers are cast to integers and vice-versa.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top