# Error loading DLL (GetLastError=193)

**URL:** <https://forums.unrealengine.com/t/error-loading-dll-getlasterror-193/447337>\
**Category:** Community & Industry Discussion\
**Tags:** dll, unreal-engine, question, load-error\
**Created:** [April 16, 2019, 12:53pm UTC](https://forums.unrealengine.com/t/error-loading-dll-getlasterror-193/447337 "2019-04-16T12:53:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DebashishPatra](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DebashishPatra](https://forums.unrealengine.com/u/DebashishPatra)\
**Post date:** [April 16, 2019, 12:53pm UTC](https://forums.unrealengine.com/t/error-loading-dll-getlasterror-193/447337/1 "2019-04-16T12:53:03Z")

</div>

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.

 ![274346-screenshot-122.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/1/0/110a748a2904b6234b36bbe79a628eab5c2a2c49.png)

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.

 ![274347-screenshot-123.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/a/7/5a772dc382810e0635b4a4ef8345ed024c6972fc.png)

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.

---

<div class="post-metadata">

**Author:** ![DebashishPatra](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DebashishPatra](https://forums.unrealengine.com/u/DebashishPatra)\
**Post date:** [April 16, 2019, 1:22pm UTC](https://forums.unrealengine.com/t/error-loading-dll-getlasterror-193/447337/2 "2019-04-16T13:22:33Z")

</div>

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

![274350-screenshot-125.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/2/262c3f2eb65b4b7c5cf719cb6bb8121562c945f3.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.

---

<div class="post-metadata">

**Author:** ![DennisMahan1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DennisMahan1](https://forums.unrealengine.com/u/DennisMahan1)\
**Post date:** [July 6, 2022, 1:55pm UTC](https://forums.unrealengine.com/t/error-loading-dll-getlasterror-193/447337/3 "2022-07-06T13:55:01Z")

</div>

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
