This section explains how to open a form developed in PowerCOBOL from a standard (non-PowerCOBOL) COBOL program. To open the form, it must be compiled into a .DLL file.
Syntax
Call "POWEROPENFORM" USING DLL-Name Form-Name
Parameters
Parameter | Property | Meaning |
---|---|---|
DLL-Name | X(260) | The name of the DLL where the form exists. |
Form-Name | X(14) | The name of the form. |
Notes
The 'POWEROPENFORM' method will not return control to the calling program until the form has been closed.
Ensure that you code the DLL-Name and Form-Name data items noted above using the correct size as indicated.
A PROGRAM-STATUS of zeroes or a positive number indicates success. A negative value indicates failure.
When you do not specify a path in the DLL-Name data item, the .DLL being called is searched for in the following order:
Current directory
Windows directory
Windows system directory
Directory where the executable program exists
Directories listed in the PATH environment variable
Every form within an application must have a unique name. Do not attempt to open a form that is already open. PowerCOBOL will return an error message if you do.
You cannot call the program recursively if the COBOL85 Language Mode is specified in this module's properties.
The form is not closed until after the all of the event programs are finished. So, close the child forms before you close the parent form.
If you use the NetCOBOL "*COM" Class you cannot use the "Activate" method. You should use the "DoModal" method.
Refer to the PowerCOBOL sample programs OpenActiveX.ppj and CallActiveX.ppj for further information.