I have a process written in Natural under Windows (5.1.1) which is a ‘monitor’ of a production process. It has a dialog to allow people to see the state of play from the console session of the relevant Application server machine. I am looking for a mechanism to automate the shutdown of this monitor process as part of an automated Production Shutdown/Restart cycle. Looking through the Natural documentation I have found the set of NGU subprograms and dialogs which seem to support a DDE based communication between a server process (the monitor process) and a client process, the shutdown request. I believe that the DDE support will be withdrawn. Alternatively is there a better/simpler solution that in my ignorance I have not found ?
Since the successor of DDE in the Microsoft ™ world was OLE Automation, support for (D)COM/Automation has been introduced to Natural for Windows (under the brand NaturalX). Thus you can use a NaturalX class to communicate with your Natural process through OLE Automation. The point that makes this approach a little tricky is that you cannot directly terminate a Natural session from within a NaturalX method call. Let me just sketch a solution that bypasses this constraint: In your dialog LDA you should have a flag that controls if the monitor process shall be shut down, which is initially false. Have a timer control in the dialog that checks this flag every now and then, and if it is true, stacks a FIN command and closes the dialog. Now you need a way to set the flag from outside the monitor process. To achieve this, start the monitor process with the COMSERVERID parameter and register a NaturalX class under that COMSERVERID. Implement a method in this class that calls into the dialog using SEND EVENT and sets the flag to true. Now in order to shut down the monitor process, instantiate the class and call that method. This is roughly how it should work. Please check the NaturalX documentation for the details on how to set up a registered NaturalX class.