OK, this may not be possible, but I have to ask:
If I have a dylib (MacOS) or DLL (Windows), could the code in that library call BACK INTO the Xojo app that invoked the call into the dylib in the first place?
I recognize the hazards of doing so – especially a circular call situation.
SCENARIO:
STEP 1) From inside the MAIN XOJO APP, a button is pressed, calling an external C-API method dylib_foo() in a dylib.
STEP 2) dylib_foo() executes, but before it completes, it calls main_bar(), a method in the MAIN XOJO APP.
STEP 3) main_bar() completes, returns control to dylib_foo().
STEP 4) dylib_foo() completes, returns control to the MAIN XOJO APP that originally invoked the external method.
I would need to provide dylib_foo() with the address of main_bar(), perhaps once when the program launches?
QUESTIONS:
Q1) Can I provide an address of a Xojo function to the dylib?
Q2) How does C-compiled code in the dylib make the call into XOJO, provide parameters, and receive return value?
Q3) If such a call can be made, are there any limitations? Can I call XOJO functions that draw to the screen, for example?
I saw some forum discussion from four years ago, where this sort of thing SHOULD work, but it seemed iffy back then.