Plugin Callback to 4D

Hi there,

I writing a plugin to implement IPC using named pipes in 4D. I have created a named pipe server on a new thread launched by the plugin. When I get a message in I would like to call back to 4D. I am attempting to do this using PA_ExecuteMethodById, however the method in 4D does not get called. When I call this command from the thread where my functions are called by 4D, this works fine.

          I am assuming that this command is not designed to be used in this way, and realise I could poll for results from 4D but I was hoping I could find a way to call in real time when needed. Any assistance would be greatly appreciated.

4D needs a ‘context’ to be able to execute most of the commands. Thus this will not work. What could work: start a new process, freeze it. When something arrives, unfreeze that process, handle the message, freeze the process again.
-> Look for PA_UnfreezeProcess.