I've also been following the Linking DLLs tutorial, creating the example DLL with "getCircleArea". After changing the solution platform to x64 it now gets the DLL handle, but
DLLgetCircleArea = (_getCircleArea)FPlatformProcess::GetDllExport(DLLHandle, *procName);
just returns a null pointer. It seems widely accepted that my function name must have changed, and I should use "depends" to check this. I downloaded depends and can't really work out where my function might be if it is there. Anyone else solved the same problem?
Here is my code (which should be exactly whats in the tutorial)
/// Declare the DLL function's type
typedef float(*_getCircleArea)(float radius);
///Define the function using the DLL's function
float ACircleActor::getCircleAreaDLL(float radius)
//FPaths::Combine(*FPaths::GamePluginsDir(), TEXT("CirclePlugin/"), TEXT("CirclesDLL.dll"));// Concatenate the plugins folder and the DLL file.
FString filePath = FPaths::Combine(*FPaths::GameDir(), TEXT("Binaries/Win64/"), TEXT("CirclesDLL.dll"));
DLLHandle = FPlatformProcess::GetDllHandle(*filePath); // Retrieve the DLL.
if (DLLHandle != NULL)
_getCircleArea DLLgetCircleArea = NULL; // Local DLL function pointer.
FString procName = "getCircleArea"; // The exact name of the DLL function.
DLLgetCircleArea = (_getCircleArea)FPlatformProcess::GetDllExport(DLLHandle, *procName); // Export the DLL function.
if (DLLgetCircleArea != NULL)
float out = DLLgetCircleArea(radius); // Call the DLL function, with arguments corresponding to the signature and return type of the function.
return out; // return to UE
And the dll code:
// CirclesDLL.cpp : Defines the exported functions for the DLL application.
float getCircleArea(float radius)
return 3.1416 * (radius*radius);
My dll is attached, as a .txt since this won't allow .dll.link text
Apr 14 '16 at 04:27 PM
in C++ Programming