Apr 30, 2018 LogServer can only accept one connection at a time, therefore we should not initialize the LogServerClient multiple times to access it from different classes / modules. Instead, declare it as a Public Process_Global and initialize the LogServerClient in your Main module, then access it from Main in other modules you want to use it from. Code: Copy Main.LS.Message("Send Message") If like me, you want to save typing, declare it as a Private Global in the module you want to access it from, and in the initialize sub of the class, or before you first access it in a module, assign the Public variable from Main to the Private Global in the module. In Main : Code: Copy Sub Process_Globals Private fx As JFX Private MainForm As Form 'Create a Global variable to point to the LogServerClient Public LS As LogServerClient . . .End Sub In other modules : Code: Copy Sub Class_Globals Private fx As JFX Private LS As LogServerClient End Sub Public Sub Initialize LS = Main.LS . . . End Sub Click to expand...
LogServer can only accept one connection at a time, therefore we should not initialize the LogServerClient multiple times to access it from different classes / modules. Instead, declare it as a Public Process_Global and initialize the LogServerClient in your Main module, then access it from Main in other modules you want to use it from. Code: Copy Main.LS.Message("Send Message") If like me, you want to save typing, declare it as a Private Global in the module you want to access it from, and in the initialize sub of the class, or before you first access it in a module, assign the Public variable from Main to the Private Global in the module. In Main : Code: Copy Sub Process_Globals Private fx As JFX Private MainForm As Form 'Create a Global variable to point to the LogServerClient Public LS As LogServerClient . . .End Sub In other modules : Code: Copy Sub Class_Globals Private fx As JFX Private LS As LogServerClient End Sub Public Sub Initialize LS = Main.LS . . . End Sub