unable to find an entry point named 'interlockedexchange'
I built an application in c# vs2005 .net .
Everything works fine when i run the application in win 32 bit, But when running the application in win 64 it crashes while trying to call the pinvoke interlockedexchange(which is within the kernel32.dll) function .
This is the exception : unable to find an entry point named 'interlockedexchange'
I didnt find the interlockedexchange function within the kernel32.dll under system32 directory but it was found under the syswow64 directory(in the kernel32.dll) .
I guess that the .net runtime is configured to the system32 directory and not to the syswow64 . How is it possible to change this configuration ? Can you think of any other problem that could cause this? any help would be appreciated! thanks ,
Miki Amit
If you are set on using InterlockedExchange and want the 32-bit version, you can change your project settings to force it to run as 32-bit. Go to the "Build" tab in the project settings and change "Platform target" to x86. It will then run as 32-bit.
这不直接回答你的问题,但为什么不调用System.Threading.Interlocked.Exhange()
而不是诉诸P / Invoke?
上一篇: 搜索DLL的DLL