How can I get a handle to a .DLL File?

I have placed my dll file in specified path and tried obtaining the handle but it won’t work (returns null).

FPaths::FileExists(DllFilename) returned true also, so I know the path exists with the file at that location.

FString DllFilename = FPaths::
ConvertRelativePathToFull(FPaths::Combine(*FPaths::GamePluginsDir(),
TEXT(“TestPlugin”), TEXT(“Binaries”), TEXT(“Win64”), TEXT(“file.dll”)));

DLLHandle = FPlatformProcess::GetDllHandle(*DllFilename);

If the file is in the project binary directory then you should omit TEXT(“TestPlugin”).

If on the other hand you want to link to the dlls in the plugin binaries folder, you need to add TEXT(“Plugins”)

It’s late, but make sure you have a x64 compiled dll. In my case that was the problem