I created a sample .dll project using Delphi 2007. (RemObjects Hydra -> Plugin Module).
A sample VS solution having the problem has been uploaded where i try to load that dll
The project you sent is not related to the issue you described. It is just a host application. Please provide full testcase that can be used to reproduce the issue.
It is related to the issue. I have just simplified the problem. This would solve the main issue also. I also added the delphi .dll project.
You can now recreate the issue using the HostApp.sln WpfApplication.zip (1000.0 KB)
The same project wouldn’t work if I change the configuration from “Any CPU” to “x64”. (I mistakenly swapped it in the previous post) Test dll.zip (1006.6 KB)
Delphi 2007 can create only x86 dll. as I understand, you are trying to load x86 plugin into x64 host…
if you want to create x64 plugin, try to use Delphi XE2+
Your ptoject has both ‘Any CPU’ and ‘Prefer 32-bit’ options enabled. This means that the app will run in 32-bit mode and will be able to load unmabaged plugin compiled as 32-bit dll. Switching to x64 mode in the host project causes it to run in 64-bit mode where it cannot load 32-bit plugins/unmanaged dlls.This is expected behavior.
In other words bitness of plugin(s) and host app should match, otherwise host app won’t be able to load plugins.