SteveTerrell Active Member Licensed User Longtime User Dec 23, 2013 #1 I have a service that does work for different activities (in the same application) at different times, something like a client-server arrangement. The service is asked to perform a time dependent operation action by a CallSubDelayed from an Activity and "replies" to it some time later with its own CallSubDelayed. I can pass the calling Activity as a parameter to the service but it cannot be stored in the Service Process_Globals. Is there some way that the Service can "remember" which activity requested the operation so that the reply CallSubDelayed goes to the correct activity?
I have a service that does work for different activities (in the same application) at different times, something like a client-server arrangement. The service is asked to perform a time dependent operation action by a CallSubDelayed from an Activity and "replies" to it some time later with its own CallSubDelayed. I can pass the calling Activity as a parameter to the service but it cannot be stored in the Service Process_Globals. Is there some way that the Service can "remember" which activity requested the operation so that the reply CallSubDelayed goes to the correct activity?
Erel B4X founder Staff member Licensed User Longtime User Dec 23, 2013 #2 You can store it as a process global variable. You should use: Code: Copy CallSubDelayed2("...", Me) 'in service Sub SomeSub(CallBackModule As Object) You can then use this object to make the call back event. Upvote 0
You can store it as a process global variable. You should use: Code: Copy CallSubDelayed2("...", Me) 'in service Sub SomeSub(CallBackModule As Object) You can then use this object to make the call back event.
SteveTerrell Active Member Licensed User Longtime User Dec 23, 2013 #3 Erel said: You can store it as a process global variable. You should use: Code: Copy CallSubDelayed2("...", Me) 'in service Sub SomeSub(CallBackModule As Object) You can then use this object to make the call back event. Click to expand... Thanks, It was saving the sender activity as an Object that I had missed. Steve Upvote 0
Erel said: You can store it as a process global variable. You should use: Code: Copy CallSubDelayed2("...", Me) 'in service Sub SomeSub(CallBackModule As Object) You can then use this object to make the call back event. Click to expand... Thanks, It was saving the sender activity as an Object that I had missed. Steve