0

So far I have been able to load the dll using the following code:

Assembly^ assembly = Assembly::LoadFrom(pathDll);

But I don't know how to detect whether it's 32 or 64 bits.

Matthew Walton
  • 9,809
  • 3
  • 27
  • 36
nix86
  • 2,837
  • 11
  • 36
  • 69
  • 1
    Possible duplicate of [How can I test a windows dll to determine if it is 32bit or 64bit?](http://stackoverflow.com/questions/495244/how-can-i-test-a-windows-dll-to-determine-if-it-is-32bit-or-64bit) – t0mm13b Apr 26 '16 at 08:14
  • You can use dumpbin utli syntax : dumpbin /headers – Venkata Naidu M Apr 26 '16 at 08:19

1 Answers1

1

I think that I've found the answer. Off course, first of all you must get the assembly associated with the dll though the following line of code:

Assembly^ assembly = Assembly::LoadFrom(pathDll);

Then you can get the information about the platform through the following code:

ProcessorArchitecture processor_architecture = assembly->GetName()->ProcessorArchitecture;
        if (ProcessorArchitecture::Amd64 == processor_architecture)
        {
            // 64bits
        }
        if (ProcessorArchitecture::X86 == processor_architecture)
        {
            //32 bits
        }
nix86
  • 2,837
  • 11
  • 36
  • 69