Possible to interact with a 64-bit COM server (Photoshop) from .NET?

后端 未结 6 994
甜味超标
甜味超标 2021-02-05 22:59

I\'ve been trying to write some code to interact with Photoshop, both by adding a COM reference and by late binding. It took me a while to realise that the code did work, but no

6条回答
  •  天命终不由人
    2021-02-05 23:32

    .NET application executables (.exe) will always run in the native bitness of the running processor architecture if marked for AnyCPU, which compiles down to MSIL. So any MSIL assembly running on a 64-bit platform will run 64-bit, and on a 32-bit platform will run 32-bit.

    In your case you'd either want to compilre for AnyCPU, but if you must force a 64-bit interop use x64. This won't work on a 32-bit machine, of course. This will natively read from the 64-bit view of the registry (including InProc

    You must also be careful of how pointers are marshaled. Be sure to use IntPtr for handles if writing your own interop proxy.

提交回复
热议问题