Deployment Guidelines

Listed below are some guidelines to consider when deploying a COM object or ActiveX control:

  1. Is there an end-user license?
    • Check with the vendor.
    • Use AXDEFGEN to generate a COBOL COPY file, which automatically embeds the required end-user license in your COBOL application.
    • If you are not using AXDEFGEN, make sure the LICENSE-KEY phrase is filled in with any necessary license information.
    • If you are using the Microsoft common controls included on the product CD, you do not need to worry about licensing. The end-user license is automatically checked out by the ACUCOBOL-GT runtime.
    • Licensing implications are discussed in Distributing Applications Containing ActiveX Controls.
  2. Are there any file dependencies?
    • What files are required (if any) to execute the control? The control vendor can tell you this. Don't ship the entire developer's installation unless you must, because this typically includes unnecessary components.
    • If external files are required, what versions should they be?
    • Does the dependent file have a dependency? If your control is made with any version of Visual Studio, it may depend on the presence of the Microsoft Visual C runtime library, or the Microsoft foundation classes of a particular version. Normally you don't have to think about this, because the COBOL Virtual Machineā„¢ already depends on these and provides them. Make a note of it though, because your component may rely on a different version and may behave oddly in the case of a mismatch.
    • For the Microsoft common controls shipped on the product CD, we provides a text file describing the control dependencies. This file is stored in the same folder as the controls.
  3. When should you install component and additional files?
    • ACUCOBOL-GT's Declaratives section covers object exceptions, or cases where an ActiveX control or COM object either did not display or terminated during execution. You can trap these kinds of events in the Object Exception part of the Declaratives. You should do this to make sure that you can control the full execution of the control, and if nothing else, make a graceful termination for your application. See Active Error Handling for additional details.
    • With the Object Exception section in place, you can use the standard DISPLAY or CREATE verb to determine if the control you are about to use is already installed. If you have an Object Exception section and create an object that is not installed, your program is thrown into the Declaratives. Using the C$EXCEPINFO library function, you can determine the cause of the failure.
    • If it is determined that the control is not installed, you should copy the files into your application directory (where you have "wrun32.exe" installed) to avoid interfering with other software and to ensure the possibility of an easy cleanup and uninstall.
    • If the control is not installed and it has a ".dll" extension, you can install it from within your COBOL application. You must copy the component files to the /bin directory and then register the files via:
      DllRegisterServer

      and

      DllUnregisterServer

      Alternatively, you can use "regsvr32" like this:

      regsvr32 activexfilename

      If you want to unregister, use this:

      regsvr32 activexfilename /U
      Note: If the control has the extension ".ocx", you may rename it to ".dll" in order to install it in ACUCOBOL-GT. The control's behavior is the same. The runtime does not recognize an ".ocx" as a ".dll". Once renamed, a control should not be renamed again.