Using a 32bit or 64bit dll in C# DllImport
I’ve found the simplest way to do this is to import the two methods with different names, and calling the right one. The DLL won’t be loaded until the call is made so it’s fine: [DllImport(“MyDll32.dll”, EntryPoint = “Func1”, CallingConvention = CallingConvention.Cdecl)] private static extern int Func1_32(int var1, int var2); [DllImport(“MyDll64.dll”, EntryPoint = “Func1”, CallingConvention … Read more