ZIEWin 2.0 ActiveX Controls

This document explains how ActiveX controls can set up in Z and I Emulator for Windows.

Introduction

The Support of ActiveX/OLE in Z and I Emulator for Windows is limited and has minimal support for Office/Lotus tools, which can be used further in automating the operations within ZIEWin. However, ZIEWin does not provide a way to embed itself as a full-fledged ActiveX object, or having it instantiated as a Form Object.

While ZIEWin provides the API interface (HACL Automation / COM objects) for .NET Framework targeted applications (such as the WinForms application), the ActiveX/OLE support provided by ZIEWin is primitive. There is no API interface to embed ZIEWin Runtime.

What has changed with Z and I Emulator for Windows v2.0?

ZIEWin 2.0 packages pcsctrX.ocx – an ActiveX Control which can be hosted in an OLE container. An OLE container control lets you add an OLE objects to your applications. OLE objects include ActiveX Controls (.OCX files) and insert-able OLE objects created in other applications such as Microsoft Word and Microsoft Excel.

After adding pcsctrX.ocx into an OLE container or an Automation Client, users can start a ZIEWin session in the ActiveX control by providing Session ID (optional) and the ZIEWin Workstation profile (mandatory). Once started, ZIEWin session will be embedded in the application.

This control supports:

  • ActiveX Control for ZIEWin achieves all the features of Statically and Dynamically Embedding ZIEWin as an ActiveX control object in a windows Form (or .NET application).

    Users can launch ZIEWin by providing two important parameters:

    1. Session ID (Optional)
      • When Set: This can be set from ‘A’ to ‘Z’.
      • Blank: The Control logic generates the SessionID and Launches the ZIEWin with next available Session ID.
      • Already Existing/Launched: Provides an option to the user to embed the same session in the ActiveX control.
    2. Session Profile (mandatory): User must provide a valid .ws profile name, else the launch of Embedded ZIEWin will fail.
      • Session Profile name may or may not have a ‘.ws’ extension.
      • If path is not provided, then the default path is picked up from the registry.
      • With Customized path, ZIEWin is launched with the .ws file from customized path.
  • Automation/Screen Scraping: Operations based on automation objects (HACL) and Emulator Programming (ELLAHPI) are supported.
    • Menu and Toolbar Items in the Embedded ZIEWin (pcsctrX) are hidden.
    • Errors/Exceptions are handled.
System Requirements

1. Visual Studio 2005 or higher: To build a client application using pcsctrX.ocx

2. Microsoft Office (32 bit): If client application executes on a Microsoft Office application

3. Z and I Emulator for Windows Ver 13.0.1.0 or higher

Installation Register pcsctrX.ocx on a system where users need to execute the OLE/Automation Container Application built with pcsctrX.ocx.To register, execute below command in command window with elevated permission:regsvr32 pcsctrX.ocxTo unregister, execute below command in command window with elevated permission:regsvr32 /u pcsctrX.ocx

InterfaceCHAR pcsOcxStartSession (CHAR sessID, BSTR wsProfile) Starts ZIEWin session in the ActiveX Control window by using a specified workstation profile and A (optional) short session ID can also be specified.

Arguments

  • sessID: Presentation space short session ID. It is optional and if not provided then next available session ID is assigned.
  • wsProfile: Path and complete filename of the profile to load. Path is optional but complete filename is mandatory.
    • Return Value.
    • Returns the Presentation space short session ID.o If sessID was provided, then same value is returned else new assigned session Id is returned.
    • If ZIEWin session failed to start, then a blank/NULL value is returned.
VARIANT_BOOL pcsOcxConnectSession(void) Connect the ZIEWin emulator to the host data stream. This has the same effect as going to the ZIEWin emulator Communication menu and choosing Connect.Arguments
  • Return Value
    • Returns true if connected successfully else false.
VARIANT_BOOL pcsOcxDisconnectSession(void) Disconnect the ZIEWin emulator to the host data stream. This has the same effect as going to the ZIEWin emulator Communication menu and choosing Disconnect.Arguments
  • Return Value
    • Returns true if disconnected successfully else false.

Limitations

ZIEWin Window Recognition pcsctrX.ocx recognizes ZIEWin window based on its name, “Session ID *“.

for e.g. Session A – [24 x 80].

If this naming standard is not followed (by changing Edit->Preferences->Display Setup configurations), then the ZIEWin session will be failed to appear in ActiveX control screen.

Redundant Disconnect context item Disconnect context Menu item which appears in a static invoke method on the pcsctrX ActiveX control is redundant. This limitation would be taken care in the upcoming release.

Menu and Toolbar state conflict If ZIEWin Session profile is same as the one specified in the Embedded ActiveX control, then ZIEWin shall be Embedded in the ActiveX control without any change in state, however, the Menu and the Toolbar items are visible. This limitation would be taken care in the upcoming release.

Known Issues To receive notification of all OIA events in a pcsctrX.ocx container application, used in Z and I Emulator for Windows method ‘RegisterOIAEvent‘, but the container application fails to receive event notification from autOIA.

Observation It is a defect in the automation API ‘RegisterOIAEvent’.