@
DonManfred I appreciate your response but ...
A code module does not seem to have a Sub Globals, only Process_Globals, so how do you propose I do that? (Creating a new code module shows me only Sub Process_Globals is all that's there.)
I also think I read you cannot have an activity in code modules. But, to me this seems to be inconsistent with allowing an activity to be passed as parameter to a routine in code module. If it can access an activity from a subroutine, it should be able to accept it for definition. Regardless, ...
@
Erel Maybe you can shed some light on this general problem. Take the licensing code only as an example, and try to make it a shared library, therefore, code module. All apps can now use this common library by only passing their 'self' as parameter.
There are four routines involved: ValidateUser(), lc_Allow, lc_DontAllow, and lc_Error. The ValidateUser() can have an extra parameter added to it which is the activity to use. The other three are call-backs from the library, and therefore cannot be altered (without messing with the library). So, the problem now is how to tell lc_DontAllow (for example) which activity to Finish. The only solution I could up with is to save the Activity passed in ValidateUser() extra argument in a variable (visible only inside this shared library code module), and then use that variable inside lc_DontAllow to run the Finish method the value having been set by the ValidateUser() sub.
So, is there a solution to this problem? (A general one, I mean. Don't think of it only in terms of this licensing example, as it applies to a whole lot more cases where you want to have shared code library deal with objects passed in from non-shared code in main application.)