# How do you load functions from a dll plugin in UE4?

**URL:** <https://forums.unrealengine.com/t/how-do-you-load-functions-from-a-dll-plugin-in-ue4/280579>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [April 14, 2014, 3:53pm UTC](https://forums.unrealengine.com/t/how-do-you-load-functions-from-a-dll-plugin-in-ue4/280579 "2014-04-14T15:53:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pal\_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pal\_2](https://forums.unrealengine.com/u/pal_2)\
**Post date:** [April 14, 2014, 3:53pm UTC](https://forums.unrealengine.com/t/how-do-you-load-functions-from-a-dll-plugin-in-ue4/280579/1 "2014-04-14T15:53:27Z")

</div>

I am still very confused about how to load functions from a dll that has no source or header files  
(just the .dll file placed in the Plugins folder)

is there anything in c++ or UE4 equivalent to Unity’s DLLImport function?

any suggestions or explanations are greatly appreciated

---

<div class="post-metadata">

**Author:** ![gmpreussner\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gmpreussner\_1](https://forums.unrealengine.com/u/gmpreussner_1)\
**Post date:** [April 14, 2014, 4:15pm UTC](https://forums.unrealengine.com/t/how-do-you-load-functions-from-a-dll-plugin-in-ue4/280579/2 "2014-04-14T16:15:51Z")

</div>

Can you explain what you’re trying to accomplish?

---

<div class="post-metadata">

**Author:** ![pal\_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pal\_2](https://forums.unrealengine.com/u/pal_2)\
**Post date:** [April 14, 2014, 4:42pm UTC](https://forums.unrealengine.com/t/how-do-you-load-functions-from-a-dll-plugin-in-ue4/280579/3 "2014-04-14T16:42:09Z")

</div>

my goal is to add a dll into the UE4 project and be able to call its functions from a c++ class

---

<div class="post-metadata">

**Author:** ![gmpreussner\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gmpreussner\_1](https://forums.unrealengine.com/u/gmpreussner_1)\
**Post date:** [April 14, 2014, 4:50pm UTC](https://forums.unrealengine.com/t/how-do-you-load-functions-from-a-dll-plugin-in-ue4/280579/4 "2014-04-14T16:50:59Z")

</div>

We provide a generic API for DLL loading and DLL function binding that is implemented for all supported platforms. The functions you are looking for are:

_FPlatformProcess::GetDllHandle_ - loads a DLL, i.e. what _LoadLibrary_ does on Windows  
_FPlatformProcess::GetDllExport_ - binds a function from a DLL, i.e. what _GetProcAddress_ does on Windows  
_FPlatformProcess::FreeDllHandle_ - unloads a DLL, i.e. what _FreeLibrary_ does on Windows

Search in the code base for usage examples.

---

<div class="post-metadata">

**Author:** ![pal\_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pal\_2](https://forums.unrealengine.com/u/pal_2)\
**Post date:** [April 14, 2014, 4:58pm UTC](https://forums.unrealengine.com/t/how-do-you-load-functions-from-a-dll-plugin-in-ue4/280579/5 "2014-04-14T16:58:51Z")

</div>

thanks for the tips gmpreussner, now I know what to look for

---

<div class="post-metadata">

**Author:** ![getnamo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/getnamo/32/1194624_2.png) [@getnamo](https://forums.unrealengine.com/u/getnamo)\
**Post date:** [April 22, 2014, 3:55pm UTC](https://forums.unrealengine.com/t/how-do-you-load-functions-from-a-dll-plugin-in-ue4/280579/6 "2014-04-22T15:55:12Z")

</div>

I just wanted to add that you can use FPaths to convert relative paths to full (FPaths::ConvertRelativePathToFull()) and combine paths (FPaths::Combine) allowing you to specify a relative path to your dll easily.
