Using kernel32 in .Net

The question is for the SO community. I have a C ++ library with full source code, and I can compile it in 32- and 64-bit mode. However, to call the code from .NET, I have to choose either 32-bit or 64-bit, so for my application it will be 32-bit or 64-bit. I decided that I might have to live with this problem ... but I came across something that gives me hope. I noticed that I can refer to "kernel32.dll" in the extern function, and the program works very well in both 32 and 64-bit. Does anyone know how to do this?

Thank!

+3
source share
1 answer

This is a Windows feature on Windows 64 (WOW64): File File Redirector

, System32. (Do , DLL System32.)

SetDllDirectory , .

+3

All Articles