so I'm trying to implement scripting using runtime-compiled c++ code. Now my problem is that when I load the DLL, it's functions see different memory than the exe's code (so getting a singleton results in a new singleton, rather than getting the exe's singleton).
So I suppose I should implement some sort of interface, so that I can call the exe's functions, and the exe's code is hidden from the gameplay code. This would enable anyone to create a gameplay c++ code or DLL and load it in the exe. I suppose this interface is needed with different script languages like lua too, so there should be a 'usual' way to handle this.
How is this usually handled?