Terminal Emulation & Transformation Community
  • Home
  • Blogs
  • FORUM
  • About
  • Contact
  • Resources

Using ActiveX Controls to interact with IBM Personal Communications

5/21/2018

1 Comment

 
Picture
Introduction
An ActiveX control is a reusable software component based on Component Object Model (COM) that supports a wide variety of OLE functionality. These controls can be used in any ActiveX container application. An ActiveX control container can be written in Visual C++, MS Excel, MS Word etc. and is a container that fully supports ActiveX controls. A container application can incorporate ActiveX controls into its own windows or dialogs.


PCOMM provides an ActiveX control, ‘PCOMM ctrX’ which allows user to embed a PCOMM session inside an ActiveX control container application. Once integrated, the PCOMM session gets embedded in the container application and users can seamlessly perform GUI operations and execute PCOMM emulator automation APIs (e.g. EHLLAPI & HACL) in this session.

Features

1.       By using ‘PCOMM ctrX’ in the container application, one can directly embed the PCOMM             session in the ActiveX control or invoke the session at the run time (lazy loading).
2.       Users can launch PCOMM by providing below parameters:

      Session ID (optional):
       o   When set: This can be ranging from ‘A’ to ‘Z’.
       o   When not set: PCOMM session is launched with next available Session ID.
       o   Already existing/launched: Provides an option to the user to embed the same session in             the  ActiveX control.
 
      Session Profile (mandatory): Users must provide a valid PCOMM .ws profile name, else the         launch of embedded PCOMM will fail.
      o   Session Profile name may or may not have a ‘.ws’ extension.
      o   If path is not provided, then the default path is picked up from the registry.
      o   With Customized path, PCOMM is launched with the .ws file from customized path.
 
3.       Automation/Screen Scraping: Operations based on automation objects (HACL) and                     Emulator Programming (ELLAHPI) are supported.
4.       Menu and Toolbar items in the PCOMM session of ActiveX control are hidden.
5.       PCOMM ActiveX provides interfaces to control the embedded PCOMM session and is                   elaborated in the below sections.
 
Interfaces
PCOMM ActiveX control exposes below interfaces to interact with the container application:
CHAR pcsOcxStartSession (CHAR sessID, BSTR wsProfile): Starts PCOMM session in the ActiveX Control window by using a specified workstation profile and A (optional) short session ID can also be specified.


VARIANT_BOOL pcsOcxConnectSession(void)
: Connect the PCOMM emulator to the host data stream. This has the same effect as going to the PCOMM emulator Communication menu and choosing Connect.

VARIANT_BOOL pcsOcxDisconnectSession(void): Disconnect the PCOMM emulator to the host data stream. This has the same effect as going to the PCOMM emulator Communication menu and choosing Disconnect.

Adding ActiveX control in the Application
Once the pcsctrX.ocx file is registered in the system, it is available to be added in an ActiveX container application. Below are few methods to add PCOMM ActiveX control in a .NET winform applications.


Using Visual Studio Toolbar –
This is the static invocation of the ActiveX.

​         1.       Open your client application project in Visual Studio (version 2005 or higher).
         2.       Open the target GUI page in design mode and select Tools -> Choose Toolbox                                 Items -> COM Components.
         3.       Under Name column, select “PCOMM ctrX” and click OK.
         4.       Draw the .OCX on the form.
         5.       When the application is launched, you will see a black screen where .OCX was                              drawn.
         6.       Right click anywhere on this black screen and click on ‘Connect’.
Picture
        7.    In the dialog box, provide session ID (optional) and PCOMM Workstation profile file                      and click OK. You can use the Browse button to browse and select an existing ws                          profile file.
Picture
         8.    An embedded PCOMM session is started within the black screen area with a                                  hidden menu and toolbar.
Picture
Figure 3 Embedded PCOMM session
Runtime invocation of ActiveX control – This is a dynamic invocation of the ActiveX.
1.       Use ‘Program ID’ of pcsctrX.ocx to load the ActiveX Control in the Application. Program ID           for pcsctrX.ocx is ‘PCOMM.ctrX’.
2.       Use ‘pcsOcxStartSession’ interface to start the PCOMM Session in above ActiveX Control.
          Sample for a C# WinForm application
Picture
Figure 4 Sample C# WinForm Application: pcsOcxStartSession
3.     Use ‘pcsOcxDisconnectSession’ to disconnect from the session in the ActiveX Control.
        Sample for a C# WinForm application
Picture
Figure 5 Sample C# WinForm Application: pcsOcxDisconnectSession
4.     Use ‘pcsOcxConnectSession’ to re-connect with the session in the ActiveX Control.
        Sample for a C# WinForm application


Picture
Figure 6 Sample C# WinForm Application: pcsOcxConnectSession
5.    Build and execute the container application. In this container application, a PCOMM session        gets embedded with the next available session ID.
       Sample for a C# WinForm application
Picture
Figure 7 Sample C# WinForm Application: Initialization
​More information on IBM PCOMM ActiveX control can be found at below link:
http://www-01.ibm.com/support/docview.wss?uid=swg22014525

Contact
For further information on automation, and services offerings please email
zServices@hcl.com  or HCL-HI-LabServices@hcl.com.
Badal Burathoki
Technical Architect, Lab Services, IBM HACP & HATS
badal.b@hcl.com
1 Comment
rush writing link
2/22/2020 02:28:44 am

Personal communications are important if you want to make a relationship. I mean, all relationships are built with both trust and communication. People underestimate it a lot, and I truly hate it. It is not okay to just be sociable online, you need to learn how to bring it when it is face-to-face. I truly wish for you to start something great with your life. I know that it will take some time, and I am hoping that it comes sooner.

Reply



Leave a Reply.

    Archives

    May 2020
    October 2019
    July 2019
    June 2019
    May 2019
    March 2019
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    October 2017
    September 2017

    Categories

    All
    HACP
    HACPEE
    HATS
    HOD
    PCOMM

    RSS Feed

Proudly powered by Weebly
  • Home
  • Blogs
  • FORUM
  • About
  • Contact
  • Resources