Here is the c++:
int UTestFunctions::TestDLLMultiplyByFour(int otherNumber)
{
typedef int(*_MultiplyByFour)(int res);
FString filePath = FPaths::Combine(*FPaths::GamePluginsDir(), TEXT("ThirdParty/CLR_TestLib.dll"));
void *DLLHandle = NULL;
if (FPaths::FileExists(filePath))
{
DLLHandle = FPlatformProcess::GetDllHandle(*filePath); // Retrieve the DLL.
}
if (DLLHandle != NULL)
{
_MultiplyByFour DLLFuncPtr = NULL;
FString procName = "MultiplyByFour";
DLLFuncPtr = (_MultiplyByFour)FPlatformProcess::GetDllExport(DLLHandle, *procName);
if (DLLFuncPtr != NULL)
{
int result = DLLFuncPtr(otherNumber);
return result;
}
}
return 0;
}