Calling OI Procedures/Popups From Arev32 (Arev32)
At 29 MAY 2009 04:59:05AM Brian McGrady wrote:
Hey all,
I've seen this demonstrated to me but I can't seem to find the code that calls the OI popups so I think the code may have been bespoke.
Basically what i've done is written a report in OI but I want my Users who use Arev32 (currently) to be able to run this from their AREV32 interface. I'm trying to keep it as simple as possible for them.
How would i go about calling OI procedures/Popups from Arev32? Can anyone shed some light?
Thanks
BMcG
At 29 MAY 2009 08:21AM Bob Orsini wrote:
Should be in the help of 9.0.
Interactions between OpenInsight and CTO
To aid in debugging your CTO routines, you may invoke them from the OpenInsight environment. Using the System Monitor (from the Tolls / Advanced OpenInsight menu), type in RUN DO_CTO "". All output will be displayed in the System Monitor window; any requests for input will cause a Message Box to appear.
You may "embed" a CTO screen in an OpenInsight GUI form. OpenInsight currently ships with two forms which have this functionality - CTO_STANDALONE_FORM and CTO_CHILD_FORM. The CTO_STANDALONE form is designed to allow you to launch a CTO session from the main GUI application screen; CTO_CHILD_FORM is designed to allow you to write OpenInsight MDIFrames that include green screen functionality.
Please note: You must create a record named CTO in the SYSENV table before using the CTO_STANDALONE_FORM. At a minimum, this record must contain the IP address of the OpenInsight system (the system where the OEngineServer is running) in field 1. Failure to create this record may cause unpredictable behaviour.
If you either the CTO_STANDALONE_FORM or the CTO_CHILD_FORM, you may also take advantage of some additional CTO/OpenInsight connectivity routines. These currently include:
Function CTO_MSG(params)
This routine opens a MSG window on your OpenInsight form. The params parameter is identical to the msgStructure parameter in the OpenInsight MSG function. This function returns the same values as the Msg function.
Function CTO_POPUP(defn, popupName)
This routine opens a PopUp window on your OpenInsight form. The defn parameter is identical to the typeOverride parameter in the OpenInsight POPUP function. This function returns the same values as the Popup function.
Function CTO_RUNWIN(cmd, mode)
This routine executes the specified cmd in the underlying Operating System environment. Both cmd and mode are passed to the UTILITY function, with the RUNWIN argument. Please see Utility RUNWIN in the OpenInsight help for more details on the mode parameter. This function currently returns 0.
Function CTO_SET_PRINTER(ctype, param1, param2, param8)
This routine calls OpenInsight's Set_Printer() function, passing it any parameters that are specified. This function returns the same values as the Set_Printer() function.
Function CTO_GUI_FUNCTION(fname, param1, param2, param20)
This routine calls any OpenInsight function that requires an "event context". Specify the name of the function as the fname parameter, and any required or desired parameters as param1, param2, etc. This function will return the return value of the specified fname function.
Function CTO_SET_PROPERTY(objName, propName, propVal)
This routine can be used to set a property in the GUI environment. Specify the name of the object in the objName parameter, the name of the property in the propName parameter, and the value you wish to set in the propVal parameter. Please note that the CTO routines, run in the character context, do NOT have access to the @window variable, and therefore you cannot specify @window (or anything derived from @window) explicitly as the object name. However, if you use the literal "@" character, CTO_SET_PROPERTY() will substitute the current @window value for the "@" literal when it invokes the actual Set_Property() function in the GUI context.
Function CTO_GET_PROPERTY(objName, propName)
This routine can be used to get a property in the GUI environment. Specify the name of the object in the objName parameter, and the name of the property to retrieve in the propName parameter. Please note that the CTO routines, run in the character context, do NOT have access to the @window variable, and therefore you cannot specify @window (or anything derived from @window) explicitly as the object name. However, if you use the literal "@" character, CTO_GET_PROPERTY() will substitute the current @window value for the "@" literal when it invokes the actual Get_Property() function in the GUI context.
Subroutine SET_OIPI_PROPERTIES(fileName, title, pageInfo, pageSetup, printSetup)
This routine allows you to customize the OIPI output generated through the CTO print routines. The parameters correspond to the first five parameters of the INIT Set_Printer message. Please refer to your OpenInsight Programmer's Reference Manual for the INIT Set_Printer Message for details.
Subroutine CTO_GUI_SUBROUTINE(sname, param1, param2, param20)
This routine calls any OpenInsight subroutine that requires an "event context". Specify the name of the subroutine as the sname parameter, and any required or desired parameters as param1, param2, etc. This subroutine calls Set_Status() to set the status code with the status of the sname subroutine.
As an alternative to using CTO_CHILD_FORM, you may include in your form the following call:
Function RUN_CHARACTER(ctlname, cmd)
The RUN_CHARACTER function will set the properties on the specified control to allow for a connection to the sample application as the GUI form is currently running in, and will invoke the specified command. If cmd is not specified, the user will be placed at TCL; if cmd is specified, the CTO session will terminate when the command terminates.
You should also be sure to have the "CLOSE" property of your window programmatically send the "disconnect" message to the OLE control to avoid having "orphaned" CTO sessions.
At 29 MAY 2009 08:34AM Brian McGrady wrote:
Bob,
Thanks for the help. Can i ask you where you got this information?
I'd like to browse through it and see if there's anything else that takes my fancy.
Brian
At 31 MAY 2009 07:39PM Barry Stevens wrote:
Enter "Interactions between OpenInsight and CTO" in your OI9 help index.
Also "CTO"
At 01 JUN 2009 08:33AM Robert Catalano wrote:
Brian,
This documentation can also be found in the Character to OpenInsight Reference Guide located in your OpenInsight directory. He is a link to this document.
Regards,
Bob
At 03 JUN 2009 05:23AM Brian McGrady wrote:
Thanks all. This is exactly what i was looking for.