Error loading DLL (GetLastError=193)

I am following [DLL linking tutorial][1]. As of VS 2017, i can’t get my DLL to work with unreal. I get the following error.

I have debugged the UE4 part of code and there is no chance of any mistakes there. As you can see any other DLL picked from any other application runs fine.

I have tried :

  • Setting VS2017 in release + x64
  • I have built dll with and without stdafx.h included
  • I have built DLL removing every include from everywhere

Would you kindly let me know what settings would one use to make compatible UE4 DLLs.
I do understand that packing proprietary DLLs into shipped project is a bad practice. But i would like to have the knowledge handy for Educational purposes.

Thank you for your help in advance.

Okay, so i found out that every DLL has to have a basic entry point which looks like the following.

274350-screenshot-125.png

Same is true for .exe files and any other windows files. The code part gets this exact pointer.

FPlatformProcess::FreeDllHandle(v_dllHandle);

It just needed to be there. I created another templated base DLL and this time it works.
No need to hate stdafx.

Seems like I’m having the same issue as you or at least similar but I’m having a little trouble understanding your solution to the problem. Where does the FPlatformProcess go and what goes in the parameter field