C# PInvoking user32.dll on a 64 bit system

后端 未结 2 1687
时光取名叫无心
时光取名叫无心 2020-12-30 22:24

Is it wrong to pinvoke user32.dll on 64 bit Windows, from a 64 bit app? I\'ve done this successfully a number of times and never had an error, but it seems contradictory.

2条回答
  •  再見小時候
    2020-12-30 22:59

    There is no user64.dll for the exact same reason you just described, .NET program can be agnostic to CPU architecture so the same code needs to work on x86 and x64.
    If you take your program to x86 platform, it will still run without any modifications.
    I guess that when they named user32.dll, they didn't have those scenarios in mind.

提交回复
热议问题