I have see this A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums
But it just use a simple function in dll,
How can i link a dll with a custom class?
for example,
in DLL decklinkDLL.cpp
decklinkDiv* go(void)
{
decklinkDiv* a = new decklinkDiv();
return a;
}
and decklinkDiv is my custom class.
in source.def
LIBRARY "decklinkDLL.dll" ;LIBRARY
DESCRIPTION “DEFDESCRIPTION” ;
EXPORTS ;
go @1;
daochu @2;
then I copy decklinkDLL.dll to Plugins folder
in unreal c++ porject
I can not ues
typedef decklinkDiv(*_decklinkDiv)(void);
#include "decklindaochu.h"
#include "decklinkP.h"
typedef decklinkDiv(*_decklinkDiv)(void);
UdecklinkP::UdecklinkP(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
// Do stuff
}
int UdecklinkP::starC( )
{
FString filePath = FPaths::Combine(*FPaths::GamePluginsDir(), TEXT("decklinkDLL.dll")); // Concatenate the plugins folder and the DLL file.
if (FPaths::FileExists(filePath))
{
void *DLLHandle;
DLLHandle = FPlatformProcess::GetDllHandle(*filePath); // Retrieve the DLL.
if (DLLHandle != NULL)
{
_decklinkDiv d = NULL;
FString procName = "go"; // The exact name of the DLL function.
d= (_decklinkDiv)FPlatformProcess::GetDllExport(DLLHandle, *procName); // Export the DLL function.
if (d != NULL)
{
d->daochu();
}
}
}
return 100;
}
Another Little Question : Can I use chinese to post my question? is there any one can speack chinese?