Loading...
 

CX_SYSTEM_OBJECT::ResetModules

CX_SYSTEM_OBJECT::ResetModules

(previously: ReinitializeInstantView)

217834 only the new name ResetModules should be used.

Description:

Calling this method puts all modules into the loaded (parsed) but not yet initialised start state ("loaded" state). This does not apply to the current module, the GLOBAL module and the modules of the current call stack.

227185 , it is additionally checked whether one of the protected modules has open windows and if so, all widget provider modules used by these modules are also protected. This rule is necessary so that the imported widgets in the still open windows do not work in an uninitialised module after ResetModules. To track which modules are protected from ResetModules , the new cx.rqdsp.resetModules logger can be used.

231940 , all modules from CX_SYSTEM_OBJECT::GetResetModulesProtectionSet (and of course their base modules) are additionally excluded from ResetModules.

All variables with module scope (including static variables) receive the initial value INVALID and all windows are closed. Static variables from base modules are only reset if all modules derived from them have been reset. With the next message sent to such a (reset) module INITIALIZE is triggered again. The module is not reloaded from the source code by this call. Changes in the source code have no effect on the reset modules. (See also: ReloadModules)

In the modules themselves this method should not be used, instead it is recommended to send the message CYBER_ENTERPRISE_SET, intercept it in the .cxp project module (formerly also defined as GLOBAL module) and execute the method only there so that the main module is not unloaded.

Code example:
2  "CX_DATABASE_2A" GetManager(OBJECT) Call(OpenDatabase) // open another database
SystemObject Call(ResetModules)  // prevent variables referring to objects in the old database

Stack
Stack Position Object type Brief description
Stack(In) Top
Stack(Out) Top
Function call: Call(ResetModules)