In my project i cannot load dll file
dll file --> platform target is x86
and my project --> platform target is Anycpu
machine is running a 64 bit OS
and this is the code i use
pDll = NativeMethods.LoadLibrary(dllname);
// some code here
static class NativeMethods
{
[DllImport("kernel32.dll")]
public static extern IntPtr LoadLibrary(string dllToLoad);
[DllImport("kernel32.dll")]
public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName);
[DllImport("kernel32.dll")]
public static extern bool FreeLibrary(IntPtr hModule);
}
why i cannot load this dll file ?
sorry for my bad English