1

Basically I'm asking how to implement the same flow as explained here.

I want my C# to supply callbacks to a native C++ DLL that I have written.

I want this DLL to be loaded by the Lua engine that's embedded into another application,
MUSHClient (a MUD/telnet client, with embedded Lua), via package.loadlib("native.dll", "someInitFunction");.

Then in MUSHClient I want to write scripts that call functions exposed by the DLL. I want these functions to call the callback function/delegate supplied by my C# application.

How can I do this?
I know how to export functions in my DLL, what I don't know is how to share the callback between processes.

Community
  • 1
  • 1
Zolomon
  • 9,359
  • 10
  • 36
  • 49

1 Answers1

1

You need some kind of Inter-process communication (IPC).

I'd recommend Named Pipes.

Here is a good example of a named pipe implementation in C# & C++.