I think you are trying to load an x86 x86 file into an x64-bit process. It is not possible to combine x86 and x64-bit. Instead, use the LoadLibraryEx function to load your .xll file into a data file.
Here is a small code example:
[Flags] enum LoadLibraryFlags : uint { DONT_RESOLVE_DLL_REFERENCES = 0x00000001, LOAD_IGNORE_CODE_AUTHZ_LEVEL = 0x00000010, LOAD_LIBRARY_AS_DATAFILE = 0x00000002, LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE = 0x00000040, LOAD_LIBRARY_AS_IMAGE_RESOURCE = 0x00000020, LOAD_WITH_ALTERED_SEARCH_PATH = 0x00000008 } internal unsafe static class ResourceHelper { [DllImport("kernel32.dll")] public static extern IntPtr LoadLibraryEx(string lpFileName, IntPtr hFile, LoadLibraryFlags dwFlags);
Hope this helps.
source share