Download

Does the user plugin support to reference another Dll?

Hi,

I want to export some functions to a dll file from another project, then use it to my own plugin.

I can get the desired result from debugging, but sometimes will get crash, sometimes it works.

Here is some piece code:



Dll file function:
bool CTestDll::ShowResult(const wstring& inName, wstring& outResult)
{
	wstring result = L"Dll function call:";

	outResult = result + inName;

	return true;
}

Plugin function:

void TestModule::StartupModule()
{

	CTestDll testDll;
	wstring toStr = L"Test";
        wstring result();
	testDll.ShowResult(toStr, result);

	//FString tmp(result.c_str());

	UE_LOG(TestLog, Warning, TEXT("%s"), result.c_str());
}


UE editor crashed cause a breakpoint here in MallocTBB.cpp file:

Do I miss something? Or it does support to reference another Dll in plugin?

Thanks.

edit:
I got it to work.
Seems wstring can’t across dll/exe to work(http://stackoverflow.com/questions/20646989/is-it-safe-to-return-stdwstring-from-a-dll).
I use TCHAR instead.