Jesse Clark
Jesse Clark

Reputation: 1

How can i... listen an events from native DLL in UnrealScript

Grteetings.

I've a question. Is this possible to listen events from native DLL in UnrealScript,when using Dllbind?

Upvotes: 0

Views: 715

Answers (1)

Gerke Max Preussner
Gerke Max Preussner

Reputation: 11

No, this is not possible. With DllBind, calls can be made from UnrealScript to the DLL, but not vice versa. There is no mechanism to call from the DLL to UnrealScript.

If you license the Unreal Engine, you are able to create native classes in C++. Native classes have the ability to call UnrealScript events. However, even native classes should not call script events at will, especially if the native code is running in a different thread. Calls from native code need to be synced up with the engine's execution, which is usually achieved by executing native code in an Actor's Tick.

Hence, the solution for you is to query the DLL from UnrealScript within Tick or Timer. If your DLL is executing asynchronous code in a thread, your DLL needs to provide a mechanism to queue up results, so that they can be accessed by the script when requested.

Upvotes: 1

Related Questions