# Adding third party DLL path for plugin

**URL:** <https://forums.unrealengine.com/t/adding-third-party-dll-path-for-plugin/359061>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [May 30, 2016, 4:50pm UTC](https://forums.unrealengine.com/t/adding-third-party-dll-path-for-plugin/359061 "2016-05-30T16:50:18Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Commander\_Shepard](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Commander\_Shepard](https://forums.unrealengine.com/u/Commander_Shepard)\
**Post date:** [December 3, 2016, 5:47pm UTC](https://forums.unrealengine.com/t/adding-third-party-dll-path-for-plugin/359061/6 "2016-12-03T17:47:51Z")

</div>

hmm, seems like you haven’t added the DLL to `PublicDelayLoadDLLs` or equivalent leading the engine to search the DLL as soon as your module (Game) loads , by default it’ll search in system32 folder where your dll probably isn’t (not that you’d want it to be there anyways).

As I understand you are trying to load DLL for a game from its main game module rather than a plugin and so you are unable to find the startup module function for your primary game module!

However its not necessary to load the DLL in that exact function you can load it anytime when you like in any function like `BeginPlay` or anything , just make sure to load it before you call any functions from it and unload (release the DLL Handle) when your game exits.

But, If you really want to load it on module startup (probably safer way) then read on:

in your ABCD.cpp file you might have something similar to following

```
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, ABCD, "ABCD" );

```

Now in ABCD.h you can define a class say `FWachrnoGame` which extends `FDefaultGameModuleImpl` and override the `StartupModule` function there and add all your dll loading in there.

Finally in the ABCD.cpp file edit the Macro to look like following

```
IMPLEMENT_PRIMARY_GAME_MODULE( FWachrnoGame, ABCD, "ABCD" );

```

That should do it. Sources

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

---

_[View the full topic](https://forums.unrealengine.com/t/adding-third-party-dll-path-for-plugin/359061)._
